- February 8, 2017
- Posted by: user
- Category: Uncategorized
I always wanted to have one common function to reset all form elements. Please have a look at jQuery code that does the same thing. It finds out all element of form and loops over it and reset them. I hope this thing will be helpful specifically where there are many search fields and you need to reset them frequently.
this.checked = false;
Note : I noticed that some time in IE selectbox is not getting cleared. So you can modify script and put [code:js]’$(this).attr("selectedIndex",0);'[/code] for ‘select-one’ case. It will work in both IE and mozilla.