, function (JSON) {
if (Json[0].areacode = = "0") {
$ ("#ddlTwo"). attr ("Disabled", true). Unformvalidator (true);//Unblock
}
else {
$ ("#ddlTwo"). attr ("Disabled", false). Unformvalidator (false); Redo Check
}}
);
Common validation:
Integer:
Copy Code code as follows:
$ ("#zs"). Formvalidator ({onshow: "Please enter an integer", Oncorrect: "Thank you for your cooperation, your whole number is correct"}). Regexvalidat
$("#password").formValidator({onshow:"请输入8-12个字符",onfocus:"请填写密码",oncorrect:"输入正确"}).inputValidator({min:8,max:12,onerror:"请输入8-12个字符"}).regexValidator({ regexp:'^(?![a-zA-Z]+$)(?![a-z0-9]+$)(?![a-z!@#\\$%]+$)(?![A-Z0-9]+$)(?![A-Z!@#\\$%]+$)(?![0-9!@#\\$%]+$)[a-zA-Z0-9!@#\\$%]+$',onerror:"(字母大写,字母小写,数字,特殊字数)中任意3类"});
jquery regular check regexvalidator that's right, why is the regular expression, the check
the user name Jquery code:
$ ("# Us "). formvalidator ({onshow: "Enter the user name", onfocus: "The user name must be at least five characters and a maximum of 10 characters", oncorrect: "This user name can be registered "}). inputvalidator ({min: 5, Max: 10, onerror: "The user name you entered is invalid. Please confirm "}). Ajaxvalidator ({Datatype: "html ",Async: True,URL: "http://www.51gh.net/chkuser.aspx? Act = OK ",Success: function (data ){If (data. indexof ("this user name can be regis
Use steps:
1. First in the project to add the necessary JS and CSS
2. Add a reference to the code (prerequisite reference)
5. Effect Chart:
6. Add Change Note:
$.formvalidator.reloadautotip (); Reload Form Validation Style if (!$.formvalidator.pageisvalid (' 1 ')) return false; If not passed then the $ (document) is not submitted. Ready (function () {$.formvalidator.initconfig ({formid: "Form1", Onerror:function
() {alert ("checksum does not pass, please see er
! ", OnCorrect:" The input is correct. Thank you for your cooperation! "}). RegexValidator ({regExp:" intege1 ", dataType:" enum ", onError:" The time format you entered is incorrect! "}); $ (" # Address "). formValidator ({onShow:" enter the name of the road show platform! ", OnFocus:" Enter one to fifty characters ", onCorrect:" The input is correct. Thank you for your cooperation! "}). InputValidator ({min: 1, max: 50, onError:" input length, no! "
written in the following sections:
1, Formid: "MyForm"MyForm is the ID of the form FORMR, required, otherwise the form is submitted with no validation effect.2. $ ("#admin")The ID of the input box admin is id= "admin"3, Min:3,max:20The control controls input box input the word number, here indicates the input word number range is 3-203, OnShow: "Fill in the background admin name"Description of the input box hint4, onfocus: "Fill in the background admin name"Description of the prompt when the i
JQuery Formvalidator Plugin's API HelpCurrently supports 5 kinds of large calibration methods, namely: Inputvalidator (for input, textarea, select control character length, value range, selection control), CompareValidator (2 objects to provide a comparison, Currently can compare strings and numeric types), Ajaxvalidator (by Ajax to the server to do data validation), Regexvalidator (provide extensible regular Expression library), functionvalidator (pr
?
12
JQuery Formvalidator Plugin's API HelpCurrently supports 5 kinds of large calibration methods, namely: Inputvalidator (for input, textarea, select control character length, value range, selection control), CompareValidator (2 objects to provide a comparison, Currently can compare strings and numeric types), Ajaxvalidator (by Ajax to the server to do data validation), Regexvalidator (provide extensible regular
messages (dictionary type) to customize the error message you want to display; Dictionary health: null, blank, invalid, Invalid_choice, unique, and unique_for_date such as: {' null ': ' cannot be empty. ' ' Invalid ': ' Malformed '} validators custom error validation (list type) to customize the desired validation rule from Django.core.validators Imp ORT regexvalidator from django.core.validators import Emailvalidator,urlvalidatoR,decimalvalidator, M
': ' cannot be empty ', ' invalid ': ' Format error '}
Show_hidden_initial=false, whether to add a hidden and default plug-in after the current plug-in (can be used to verify that two times the input has been). is to create a hidden, identical label next to your label, and you can compare whether the user's label has changed relative to the previous state.
Validators=[], custom validation rules, where an error exception is imported, such as Rege
Introduction:
First of all, please come with me to review the Bridge Mode in the design mode. There is not much nonsense:
In this design pattern, our abstract classes and implementation classes can be expanded and encapsulated separately so that they can be decoupled and many changes can be produced through combination. This idea also conforms to the design principle of "less inheritance and more combination. in the bridge mode, we can use the aggregate action class to bridge the ConreteImplem
ajaxvalidator function that has many problems as follows:A. All form values in the same group can be passed to the server.The name attribute must be added for each control. Otherwise, the attribute will not be passed.B. Remove the addidvalue parameter. On the server side, you can obtain the ID of the control that triggers verification using clientid.C. Add Ajax parameters for formvalidator (values: True, false, default: True) to indicate whether ajaxvalidator submits the form to the server.
Introduction:
First of all, please come with me to reviewBridging Mode(BRIDGE:
In this design mode, our abstract classes and implementation classes can be expanded and encapsulated separately so that they can beDecoupling, And many changes are produced through combination. This idea is also in line with"Less inheritance, more combinations"In the bridge mode, we can use the aggregate action class to bridge the conreteimplementor and the refinedized abstract class. But how does JavaScrip
, it indicates the role of this input box. error_messages = {"min_length": "You are too short.", "max_length ": "You are too long to stand it... "," required ":" cannot be blank "}) Gender = forms. choicefield (choices = (1, "male"), (2, "female"), (3, "unknown ")), # Only One widget = widgets can be selected for a single response. radioselect (), label = "gender") Hoby = forms. choicefield (choices = (1, "soccer"), (2, "basketball"), (3, "two-color ball"), widget = widgets. checkboxselectmultip
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.