Connecting Tech Pros Worldwide Help | Site Map

onclick does not work with Input type=image

Wayne
Guest
 
Posts: n/a
#1: Jul 20 '05
Please help... For some odd reason onclick is not working with and
<input type="image"> but works fine on an <input type="button">....

This does not work:
<input TYPE="image" src="go.gif"
onclick="thisthis(form.text1.value,form.select1.va lue)">

But this works fine:
<input TYPE="button" width="20" VALUE="SEARCH"
onclick="thisthis(form.text1.value,form.select1.va lue)">

Any help would be much appreciated... Thanks
Lee
Guest
 
Posts: n/a
#2: Jul 20 '05

re: onclick does not work with Input type=image


Wayne said:[color=blue]
>
>Please help... For some odd reason onclick is not working with and
><input type="image"> but works fine on an <input type="button">....[/color]

The odd reason is that the input of type image was intended
specifically to submit the form. If you want to do something
other than submit a form, use the onClick handler of an image,
or of a Link containing an image.

Closed Thread