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.
- Mvc Client validation
- Then jQuery.Ajax Post.