Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q211 Why when using a form input type of "image" is the onClick event handler ignored in Netscape?

irt.org | Knowledge Base | JavaScript | Image | Q211 [ previous next ]

Q211 Why when using a form input type of "image" is the onClick event handler ignored in Netscape?

According to the Netscape JavaScript Reference manual there isn't a form input type of image. Therefore there can't be any event handlers for a non existent input type.

You could replace your non existent image input type with a proper image tag wrapped up in a proper link tag:

<form name="formname">
<a href="javascript:myfunction()"><img src="picture.gif" width="16" height="16" border="0"></a>
</form>

Now you can either use the myfunction() function to submit the form using document.formname.submit() - which will fail if the action of the form is mailto:, or you can use the myfunction() function to perform form validation first and then submit the form. The document.formname.submit() does not in itself invoke the forms onSubmit event handler.

Feedback on 'Q211 Why when using a form input type of "image" is the onClick event handler ignored in Netscape?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 6th July 2009. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2009 irt.org, All Rights Reserved.