asp.net mvc - Reset MVC form with jquery -


How do I fix a form?

i.e. Clear the values ​​of all areas and remove verification. Error message validation - summary-errors with jquery

I use the code below but it does not work:

  var validator = $ ("#myform") valid (); Validator.resetForm ();   

I am using ASP.NET MVC3 and jquery scripts are included in my page.

  & lt; Script src = "@ Url.Content (" ~ / Scripts / jquery-1.4.4.min.js ")" type = "text / javascript" & gt; & Lt; / Script & gt; & Lt; Script src = "@ Url.Content (" ~ / scripts / jquery.validate.min.js ")" type = "text / javascript" & gt; & Lt; / Script & gt; & Lt; Script src = "@ Url.Content (" ~ / script / jquery.validate.unobtrusive.min.js ")" type = "text / javascript" & gt; & Lt; / Script & gt;    

  $ ('.field-verification-error') .removeClass ( 'Field-verification-error') .addClass ('field-validation-valid'); $ ('Input-Verification-Error') .removeClass ('Input-Verification-Error') .addClass ('Valid');    

Comments