How do I reset a form?
i.e. Clear values of all fields and remove ValidationSummary error messages validation-summary-errors with jquery.
I use the below code but it does not work:
var validator = $("#myform").validate();
validator.resetForm();
I'm using asp.net MVC3 and the jquery scripts are include in my page.
<script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
See Question&Answers more detail:os