jQuery/Javascript function to clear all the fields of a form -



jQuery/Javascript function to clear all the fields of a form -

this question has reply here:

resetting multi-stage form jquery 29 answers

i looking jquery function clear fields of form after having submitted form.

i not have html code show, need generic.

can help?

thanks!

you can utilize javascript's native reset() method reset entire form default state.

example provided ryan:

$('#myform')[0].reset();

note: may not reset fields, such type="hidden".

update

as noted ilyadoroshin same thing can accomplished using jquery's trigger():

$('#myform').trigger("reset"); update

if need more reset form default state, should review answers resetting multi-stage form jquery.

javascript jquery

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -