1

This question was asked but was not answered.

I have contact form and I am using Data Annotations for the ContactFormModel. I add this line <% Html.EnableClientValidation(); %> to top of the form.

When I click the submit button client validation works perfectly. Now I have changed my mind and want to post the form with jQuery.Ajax.

This time I want to accomplish this.

  • Click submit button.
  • MicrosoftMVCValidation does the client validation and renders the errors on the clientside.
  • If Model is valid I meant if the validation passed I want my jQuery AJAX to get involved.
  • But when I clicked the submit button both AJAX post and mvc client validation works. How can I get the things in right order.
  1. Mvc Client validation
  2. Then jQuery.Ajax Post.
halfer
  • 19,824
  • 17
  • 99
  • 186
theateist
  • 13,879
  • 17
  • 69
  • 109

1 Answers1

-1

I found the solution.

Use these JS :

jquery-1.4.2.min.js
jquery.validate.js    
MicrosoftAjax.debug.js
MicrosoftMvcAjax.debug.js    
MicrosoftMvcJQueryValidation.js
theateist
  • 13,879
  • 17
  • 69
  • 109