471,338 Members | 1,301 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,338 software developers and data experts.

use imagebutton to reset form..

How can I reset a form using an Image Button.. I tried using and HTML
button and some javascript to reset the form, but it doesn't work.. any
suggestions?

Jul 21 '05 #1
3 3500
Brian,

Some plain old javascript will do the trick for you. Just add a regular
<img> tag and add an onclick handler that will call the form's reset() method.

Example:
<img src="myimage.jpg" onclick="document.forms[0].reset()">

HTH
Jorge

"Brian" wrote:
How can I reset a form using an Image Button.. I tried using and HTML
button and some javascript to reset the form, but it doesn't work.. any
suggestions?

Jul 21 '05 #2
onclick="formname.reset()" won't work?
Jul 21 '05 #3
I didn't try just using an image.. I tried using the imagebutton and
setting some javascript on that.. wouldn't work.. It just submitted the
form.. Jorge, I will try that image thing for reference. I
convinced them to just remove the reset button. That is a much easier
solution.. lol.. Thank you both for your replies..

Jul 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Chuck Hartman | last post: by
2 posts views Thread by CJ Oakwood | last post: by
3 posts views Thread by Brian | last post: by
reply views Thread by Tom Edelbrok | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.