how to manually trigger xval or to know if page is valid

Apr 22, 2010 at 3:47 PM


i want to know if is it possible to trigger xvalidation :) without pressing submit button.

And is it possible to know if page is xvalid.


We want to make ajax calls, but we also want to make sure the page is valid first. I have done some googling and found one kinda similar question.


Any suggestions?



Apr 27, 2010 at 6:31 AM


May 5, 2010 at 10:33 AM

the project coordinator last visit was :   8 february 2010

May 5, 2010 at 11:01 AM

I apologise for being slow to respond to these queries! At the moment I'm putting a lot of time into finalising my MVC 2 book and speaking at user groups on top of my usual full-time work, and this means the amount of time I have to handle general support requests (for xVal and other ASP.NET MVC-related questions) is limited.

People using xVal often ask questions about changing client-side validation behaviour in various ways, and what I guess I failed to make clear enough when initially documenting xVal is that xVal doesn't do your client-side validation - it's a bridge that converts server-side rules into a client-side configuration that can be picked up by something like jQuery Validation. Assuming you're using jQuery Validation, then that's what's responsible for the client-side behaviours, not xVal. If you want to provoke jQuery Validation to perform validation at an arbitrary time, check jQuery Validation's documentation. In this example, the method I think you want is:


... or at least that's what implies.

Sorry for any confusion about this.

May 5, 2010 at 3:19 PM

Thank you for your response Steve, and good luck with your book.

We solved the problem, and as of now we are quite happy with xVal. It's a life saver :)

For others who may face the same proble.We managed to do this by using "$('form').validate().settings.submitHandler". It took a long time but it's got nothing to do with xVal. The problem was our lack of experience with jquery :)