I validate the form using jquery validation plugin ......
rules: { Name: "required", MobileNo: { required: true, minlength: 10, remote: '<%=Url.Action("getClientMobNo", "Clients") %>' }, Address: "required" }, messages: { Name: "please provide a client name", MobileNo: { required: "Please provide a mobile phone no", rangelength: jQuery.format("Enter at least {0} characters"), remote: jQuery.format("This MobileNo is already in use") }, Address: "please provide client address" },
This works well when adding form validation, but I use the same form for editing, here they can use the same mobile number, but my plugin confirms that mobileno says that it is already mobile ... But how to execute the remote attribute on basis provided
MobileNo: { required: true, minlength: 10, if($("#HfId").val() == ""){ remote: '<%=Url.Action("getClientMobNo", "Clients") %>' } },
Is this a valid conditional condition for jQuery conditional checking .... How to skip a remote attribute based on a condition ....
source share