jquery validation remote depends validation trigger condition

Source: Internet
Author: User

Background:

1: Data modification page;

2: Mailbox cannot be duplicated


Modify the page, the mailbox is brought out by default, but the field with Remote authentication, cannot be duplicated, the focus is lost by the mailbox input box, will trigger Remote authentication by default,


Introduction complete





Solution:

When the mailbox has no change, do not actively trigger remote authentication;


Turned on GitHub plug-in issues, see an article https://github.com/jzaefferer/jquery-validation/issues/431, the Great God provides the perfect plan,

Email:{required:true,email:true,maxlength:100,remote: {depends:function (Element) {                return element.value!== " ${client.email} ";            },param: {url:" ${ctx}/account/checkemail ", Cache:false}}}



jquery validation remote depends validation trigger condition

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.