...

View Full Version : input type=image [!submit the form, NN4]



jamescover2
08-24-2002, 02:10 AM
Hi:

I've read through some previous posts, but couldn't find a solution to using a "reset" button with type=image that will work in NN4 without submitting the form. I've already tried return false, reset(), and some others, which do work in IE, but I haven't been able to come up with a custom function that will prevent NN4 from submitting the form.

Does anyone know of a workaround for this?


Thanks for any assistance.


James
He is risen!!!

requestcode
08-24-2002, 05:20 AM
A type of image is for submitting forms only. You should not use it for anything else. You could use a normal link and img tag to do the reset like this:
<A HREF="javascript:document.form_name.reset()"><IMG SRC="sub.gif" NAME="subimg" BORDER="0"></A>

or

<A HREF="javascript:void" onClick="document.form_name.reset()"><IMG SRC="sub.gif" NAME="subimg" BORDER="0"></A>

jamescover2
08-24-2002, 06:09 AM
Thanks, Jyoung. Here is what I used:


<a href="javascript:void(0);" onClick="document.myForm.reset();return false;"><img src="clearForm.gif" border="0"></a>

Works a treat. Thanks, again. I appreciate it.


James
He is risen!!!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum