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 answersi 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"
.
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
Post a Comment