JQuery Validation Plugin: Use Custom Ajax Method -
Receiving some help if possible.
I am validating the email field of my form, by staging an AJAX call on my database, which checks that the text in the email field is currently in the database. Check email validity on Blogger $ ('# sEmail') Blur (function () (// Forms from the form # Welcome = $ ('# sEmail'). Serialize data for ARAP email iddata = {sEmail: itemValue} // What is Ajax call $ .getJSON ('http: // Localhost: 8501 / ems / trunk / www / cfcs / admin_user_service.cfc? Method = getAdminUserEmail and back format = JSON and queryformat = column ', email data, function (data) {if (data! = False) {Var ErrorMessage = 'This email address is already registered';} else {var errorMessage = 'Good'}})});
What I would like to do is call this JQuery validation Adding to the rules of the plugin ... as well Validate ({rule: {sEmail: {expected: function () {// call my Ajax email on my pulse}}, Message: { SEmail: {Required: "This email already exists"}};
What are you thinking if anyone is looking for it? Thanks a lot
< / Div>
You are requesting an AJAX, Ergo: Verification gives your custom validator either right or wrong.
You also have to work with Ascend See also:
We say that we have a custom verification to test unique mobile, then we will add a new way , Which should check the mobile number:
JQuery.validator.addMethod ("unique mobile", function (value, element) {var response; $ .ajax ({type: "post" , Url: & lt; your server script / method & gt; data: "mobile =" + value, async: wrong, success: work (data) {symbol Ria = data;}}); (reaction == 0) {back true;} and if (reaction == 1) {return false;} and if (answer == 'logout') {return false;}}, "Mobile is already taken");
Comments
Post a Comment