I’m trying to use asp.net mvc’s 2 client validation ( <% Html.EnableClientValidation(); %>) with a modal box (facebox). and can’t get it to work. I’ve tried the following solutions and none of them worked:
http://aspnet.codeplex.com/WorkItem/View.aspx?WorkItemId=5270
http://tpeczek.com/2010/04/making-aspnet-mvc-2-client-side.html
I’ve tried both MicrosoftMvcJQueryValidation.js and MicrosoftMvcValidation.js.
The thing is that the validation apparently doesn’t load the form in the modal (facebox), while it does load the forms which are not in the modal.
anybody has an idea?
Hello I finally found a complete solution for client validating asp.net mvc with modal and ajax form :
Code1
Code2
If you are using jquery forms than just add beforeSubmit: validate to your ajax form options.
that’s it!