onclick does not work with Input type=image

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Wayne

    #1

    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="thisth is(form.text1.v alue,form.selec t1.value)">

    But this works fine:
    <input TYPE="button" width="20" VALUE="SEARCH"
    onclick="thisth is(form.text1.v alue,form.selec t1.value)">

    Any help would be much appreciated... Thanks
  • Lee

    #2
    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.

    Comment

    Working...