I have tried $("#client.frm").reset(); but it is not working.So how to reset form via jquery?
views:
66answers:
2
+5
A:
form.reset() is a DOM element method (not one on the jQuery object), so you need:
$("#client.frm")[0].reset();
//faster version:
$("#client")[0].reset();
Or without jQuery:
document.getElementById("client").reset();
Nick Craver
2010-09-24 11:43:40
ya its working.. thanks dude
Loganphp
2010-09-24 11:50:52
@Loganphp: If this answered your question (and it seems it did), please click the checkmark that appears just to the left of the beginning of the answer to "accept" it. This is how StackOverflow works. When you accept an answer, the question shows up as "answered", and Nick gets a bit of love for having supplied the right answer.
T.J. Crowder
2010-09-24 11:56:47
+1
A:
,reset() method does not clear the default values and checkbox field and there are many more issues.
In order to completely reset check the below link -
http://www.javascript-coder.com/javascript-form/javascript-reset-form.htm
Alpesh
2010-09-24 12:06:16