Connecting Tech Pros Worldwide Help | Site Map

onclick does not work with Input type=image

  #1  
Old July 20th, 2005, 12:02 PM
Wayne
Guest
 
Posts: n/a
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
  #2  
Old July 20th, 2005, 12:03 PM
Lee
Guest
 
Posts: n/a

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
script carrying over file with no problem but not text cassbiz answers 4 April 28th, 2008 09:05 PM
HELP: Javascript does not work in Firefox Papelotte answers 7 November 3rd, 2006 06:21 PM
x,y coordinates from an <input type='image'> jackiepatti@gmail.com answers 3 August 24th, 2006 10:15 AM