use imagebutton to reset form..

  • Thread starter Thread starter Brian
  • Start date Start date
B

Brian

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?
 
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
 
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..
 
Back
Top