Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #22756

Re: How to transform a image into clickable button?

Path csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail
From Joao Rodrigues <groups_jr-1@yahoo.com.br>
Newsgroups comp.lang.javascript
Subject Re: How to transform a image into clickable button?
Date Thu, 23 Jan 2014 10:33:26 -0200
Organization Aioe.org NNTP Server
Lines 39
Message-ID <lbr26j$7gp$1@speranza.aioe.org> (permalink)
References <c53894b4-67ec-4764-a9ac-1fa52bc2e40b@googlegroups.com>
NNTP-Posting-Host 8Q2Ixs6JRjEmSRWhmdSr/w.user.speranza.aioe.org
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Complaints-To abuse@aioe.org
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0
X-Notice Filtered by postfilter v. 0.8.2
Xref csiph.com comp.lang.javascript:22756

Show key headers only | View raw


Em 21/01/2014 19:14, vla.figueiredo@gmail.com escreveu:
> [ I'm really a noob on coding ]
>
> I'm creating a e-mail mkt with 2 buttons on it.
>
> I've already placed an image and linked with the right source from my
> server. Now I want to transform this image into a clickable button.
>
> How?
>
> tnx
>

You don't need a client-side JavaScript code to accomplish what you want 
to do. E.g. (submitting a form):

<button name="btnSubmit" type="submit">
<img alt="" src="/img/select.gif" />
Submit</button>

However, you can use the button's onclick attribute to execute a JS 
function for instance. In this case, you might use type="button" instead 
of type="submit". E.g.

<button name="btn1" type="button" onclick="alert('hi')">
<img alt="" src="/img/image1.gif" />
Action 1</button>

<button name="btn2" type="button" onclick="alert('hey')">
<img alt="" src="/img/image2.gif" />
Action 1</button>


See:
<http://www.w3.org/TR/html401/interact/forms.html#edef-BUTTON>
<http://www.w3.org/TR/html401/interact/scripts.html>

-- 
Joao Rodrigues (J.R.)

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How to transform a image into clickable button? vla.figueiredo@gmail.com - 2014-01-21 13:14 -0800
  Re: How to transform a image into clickable button? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-01-21 22:57 +0100
  Re: How to transform a image into clickable button? Denis McMahon <denismfmcmahon@gmail.com> - 2014-01-21 22:30 +0000
  Re: How to transform a image into clickable button? Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2014-01-23 10:33 -0200
    Re: How to transform a image into clickable button? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-01-23 16:01 +0100
      Re: How to transform a image into clickable button? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-01-23 16:13 +0100
        Re: How to transform a image into clickable button? "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2014-01-23 17:57 +0200
          Re: How to transform a image into clickable button? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-01-23 17:08 +0100
            Re: How to transform a image into clickable button? "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2014-01-23 18:37 +0200
              Re: How to transform a image into clickable button? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-01-23 20:13 +0100
                Re: How to transform a image into clickable button? "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2014-01-23 21:23 +0200

csiph-web