Connecting Tech Pros Worldwide Help | Site Map

onclick does not work with Input type=image

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 20th, 2005, 11:02 AM
Wayne
Guest
 
Posts: n/a
Default onclick does not work with Input type=image

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, 11:03 AM
Lee
Guest
 
Posts: n/a
Default 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.

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.