ASP.NET MVC2 RC : How to intercept or trigger client-side validation before ajax request? -
I have a user name text box on the form that has some validity rules applied through the DataAntiation attributes:
I also have a button next to this text box, which closes a jQuery AJAX request that checks the existence of a username:
< Pre> & lt; Button onclick = "check (this); return false;" Id = "FtpLoginCheck" name = "FtpLoginCheck" & gt; available? & Lt; / Button & gt;
I am looking for a way to share the two together so that click on the "check" before the client-side verification call arrives. / P>
EDIT: To be more clear, I need to inspect or trigger the client side verification result of the text box, when I click on the unconnected button without it.
EDIT: I now check the JSON JS ("form") button. Valid (). Is invalid, but is not displaying general verification message. About
Any thoughts?
OK if my solution is to manually trigger the button Button onclick event: -
var validator = $ ("form") ({submitHandler: function (form) {/ * nothing *}}); If return (validator.errorList.length & gt; 0);
Comments
Post a Comment