Forum Moderators: open

Message Too Old, No Replies

Reset form function (type="image")

Reset function without using JavaScript

         

SilverLining

4:48 pm on Jan 31, 2006 (gmt 0)

10+ Year Member



Hi everybody

Is this at all possible? The following code works fine


<input type="reset" class="reset" name="reset" value="reset"/>

but what i really want is an image (type=image). The problem is i dont want to use JavaScript to reset the button.

Please advise if you know the trick would be appreciated.

Thanks!

httpwebwitch

4:08 am on Feb 1, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Unless you use the built-in "reset" button, you will need to use Javascript.

Thankfully, the javascript you need is old as the hills and supported by every browser ever invented.

<input type="image" onClick="this.form.reset()">

or

<a href="javascript:this.form.reset()"><img src="mybuttonimage.gif"></a>

I am curious.
Why are you reluctant to use Javascript?

SilverLining

1:12 pm on Feb 1, 2006 (gmt 0)

10+ Year Member



hi httpwebwitch
thanks for your response, however it is for accessibility improvement (for graphic browsers) - so a blind person cant use 'onclick'...
SL

Robin_reala

1:16 pm on Feb 1, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



To be honest I wouldn't bother with a reset button. You run the risk of users clicking on them by accident, and they're certainly not necessary for accessibility purposes.