Released to the original articleArticleIt's up.
Http://www.cnblogs.com/wzmaodong/archive/2008/01/11/1034901.html
The new version will be released after playing badminton in the evening!
Http://www.yhuan.com/formvalidator/index.html
Main content of this update
1. Added support for select-multiple verification,So far, the plug-in has supported verification of all controls.
Use inputvalidator to verify this type
attribute |
property name |
default value |
explanation |
type |
comparison type |
"size" |
(invalid for select) "size": indicates the comparison length "Number": numeric comparison "string": Comparison |
min |
minimum length/value |
0 |
default numeric type. If character comparison is performed, please generate the character type for select-multiple, the min and Max parameters in inputvalidator indicate the number of selected characters |
max |
maximum length/value |
99999999999 |
same as above |
onerror |
error prompt |
"input error" |
blank users are not displayed. |
onerrormin |
A prompt that is smaller than the min attribute |
null |
error message when the value entered by the user is smaller than the min attribute |
onerrormax |
A prompt with a property greater than Max |
null |
error message when the value entered by the user is greater than the max attribute |
ExampleCode: For details, see the new example in demo1.
$ ("# Selectmore "). formvalidator ({onshow: "press Ctrl to select multiple", onfocus: "press Ctrl to select multiple, at least two", oncorrect: "Thank you for your cooperation "}). inputvalidator ({min: 2, onerror: "select at least 2 "});
2. Added support for setting multiple default values for the checkbox. For more information, see the code in "select hobby 2" in demo1.
$ ("Input: checkbox [@ name = 'checkbox8']"). formvalidator ({tipid: "test2tip", onshow: "Please select your interests (at least two, up to three)", onfocus: "You should select at least two, you can select up to 3 ", oncorrect:" Congratulations, you have selected ",Defaultvalue: ["7", "8"]}). Inputvalidator ({min: 2, Max: 3, onerror: "The number you selected is incorrect (at least two, up to three )"});
Note that defaultvalue must be an array