Localized files for jquery validation

Source: Internet
Author: User

In fact, many people should know, here or put a backup to mention a wake up.

The default validation information is in English, if you want to localize, or replace

Messages: {required: ' This field is required. ', Remote: ' Please fix this field. ', email: "Please
        Enter a valid email address. ", url:" To enter a valid URL. ", Date:" Please enter a valid date. ", Dateiso: "Please enter a valid date (ISO).", Number: "To enter a valid number.", digits: "Please E Nter only digits. ', CreditCard: ' Please enter a valid credit card number. ', Equalto: "Please enter the SAM E value again. ", Accept:" Please enter a value with a valid extension. ", MaxLength: $.validator.format (" Pl Ease enter no more than {0} characters. '), minlength: $.validator.format ("Please enter at least {0} characters.") , Rangelength: $.validator.format ("Please enter a value between {0} and {1} characters long."), Range: $.V Alidator.format ("Please enter a value between {0} and {1}."), Max: $.validator.format ("Please enter a value less t
 Han or equal to {0}. "),       Min: $.validator.format ("Please enter a value greater than or equal to {0}.") },

Or you can go.

Http://ajax.aspnetcdn.com/ajax/jquery.validate/1.10.0/localization/messages_##.js

The next localized good bag, # #是对应的区域代码, for the celestial, nature is en

Http://ajax.aspnetcdn.com/ajax/jquery.validate/1.10.0/localization/messages_zh.js

PS. Inside is actually


 * * Translated default messages for the JQuery validation plugin.
 * LOCALE:ZH (Chinese, Chinese (zhōngwén), Chinese, Hans) *
 *
jquery.extend (jQuery.validator.messages, {
    required: "Required fields") ",
    remote:" Please fix this field,
    email: "Please enter the correct format email",
    URL: "Please enter a valid URL",
    Date: "Please enter a valid date",
    Dateiso: " Please enter a valid date (ISO). ",
    Number:" Please enter the valid numbers ",
    digits:" Enter only integer ",
    creditcard:" Please enter legal credit card number ",
    Equalto:" Please enter the same value again,
    accept: "Please enter a string with a valid suffix name",
    maxlength:jQuery.validator.format ("Please enter a string with a length of up to {0}"),
    Minlength:jQuery.validator.format ("Please enter a string with a length of at least {0}"),
    Rangelength:jQuery.validator.format ("Please enter a length between {0} and {1},
    Range:jQuery.validator.format ("Enter a value between {0} and {1}"),
    Max:jQuery.validator.format (" Please enter a value of {0},
    Min:jQuery.validator.format (Please enter a value of min {0})
});

Save a JS file after validate load on the line. By the way, you can make up a date to verify the bug mentioned in the article.

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/webkf/jquery/

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.