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

Apr 22, 2010 at 2:47 PM

Hi,

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.

Here: http://xval.codeplex.com/Thread/View.aspx?ThreadId=49138

Any suggestions?

 

Thanks...

Apr 27, 2010 at 5:31 AM

Anyone?

May 5, 2010 at 9:33 AM

the project coordinator last visit was :   8 february 2010

Coordinator
May 5, 2010 at 10: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:

$("#myform").validate().form()

... or at least that's what http://docs.jquery.com/Plugins/Validation/Validator/form implies.

Sorry for any confusion about this.

May 5, 2010 at 2: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 :)