jquery form Validation

Source: Internet
Author: User

. Add references in code (required references)

    <script src= "Scripts/jquery-1.4.1.min.js" type= "Text/javascript" ></script> <!--jquery must be library--    <script src= "formvalidator1/formvalidator-4.0.1.min.js" type= "Text/javascript" ></script> <!-- Form validation must be library--    <script src= "formvalidator1/formvalidatorregex.js" type= "Text/javascript" ></script > <!--form Validation Extension Library--    <link href= "formvalidator1/style/validator.css" rel= "stylesheet" type= "Text/css"/ ><!--Form Validation style sheet-

tags to be validated in 3.<body> (do some common demos)

<table border= "0px" style= "font-size:12px" > <tr> <td colpan= "3" ><input type= "submit" name= "but Ton "id=" button "value=" Submit "/></td> </tr> <tr> <td align=" right "> identity card (Regular expression library): </t d> <td><input name= "SFZ" type= "text" id= "SFZ"/></td> <td><div id= "Sfztip" style= " width:300px "></div></td> <!--It's important to note here that the ID value of the div in the validation message is a little more than a tip for the ID value in the control to be validated, as in the following. Must be more tip, also must be more. -</tr> <tr> <td align= "right" > ID card (external function):</td> <td><input type= "Tex T "id=" SFZ1 "style=" width:120px "/></td> <td><div id=" Sfz1tip "style=" width:300px "></div>  </td> </tr> <tr> <td align= "right" > Integer:</td> <td><input type= "text" Id= "Zs" style= "width:120px"/></td> <td><div id= "Zstip" style= "width:300px" ></div></t  D> </tr> <tr>     &LT;TD align= "Right" > Positive integer:</td> <td><input type= "text" id= "Zzs" style= "width:120px"/></t       d> <td><div id= "Zzstip" style= "width:300px" ></div></td> </tr> <tr> &LT;TD align= "Right" > Negative integer:</td> <td><input type= "text" id= "Fzs" style= "width:120px"/></td&gt      ; <td><div id= "Fzstip" style= "width:300px" ></div></td> </tr> <tr> <td Ali Gn= "Right" > Digital:</td> <td><input type= "text" id= "sz" style= "width:120px"/></td> <td ><div id= "Sztip" style= "width:300px" ></div></td> </tr> <tr> <td align= "rig HT "> Positive number (positive integer + 0):</td> <td><input type=" text "id=" Zs1 "style=" width:120px "/></td> &lt ; Td><div id= "Zs1tip" style= "width:300px" ></div></td> </tr> <tr> <td align= "Right" > negative (Negative integer) + 0):</td> <td><input type= "text" id= "FS" style= "width:120px"/></td> <td><div Id= "Fstip" style= "width:300px" ></div></td> </tr> <tr> <td align= "right" > floating-point numbers: </td> <td><input type= "text" id= "FDS" style= "width:120px"/></td> <td><div id= " Fdstip "style=" width:300px "></div></td> </tr> <tr> <td align=" right "> Positive floating point: &lt ;/td> <td><input type= "text" id= "Zfds" style= "width:120px"/></td> <td><div id= "ZF Dstip "style=" width:300px "></div></td> </tr> <tr> <td align=" right "> Negative floating point number:< /td> <td><input type= "text" id= "Ffds" style= "width:120px"/></td> <td><div id= "FfD  STip "style=" width:300px "></div></td> </tr> <tr> <td align=" right "> Non-negative floating-point number (positive floating point number) + 0):</td> &Lt;td><input type= "text" id= "Fffds" style= "width:120px"/></td> <td><div id= "FffdsTip" style= "width:300px" ></div></td> </tr> <tr> <td align= "right" > Non-positive floating-point number (negative floating point + 0): </t d> <td><input type= "text" id= "Fzfds" style= "width:120px"/></td> <td><div id= "fzfd STip "style=" width:300px "></div></td> </tr> <tr> <td align=" right "> Color: </td > <td><input type= "text" id= "ys" style= "width:120px"/></td> <td><div id= "YsTip" s Tyle= "width:300px" ></div></td> </tr> <tr> <td align= "Right" > Your EMAIL:&LT;/TD&G      T <td><input type= "text" id= "email" style= "width:120px"/></td> <td><div id= "EMAILTIP" style = "width:300px" ></div></td> </tr> <tr> <td align= "right" > Phone:</td> & Lt;td><inpUT type= "text" id= "SJ" style= "width:120px"/></td> <td><div id= "Sjtip" style= "width:300px" ></ div></td> </tr> <tr> <td align= "right" > Zip code:</td> <td><input type = "text" id= "YB" style= "width:120px"/></td> <td><div id= "Ybtip" style= "width:300px" ></div&gt ;</td> </tr> <tr> <td align= "right" > Non-empty:</td> <td><input type= "text "Id=" FK "style=" width:120px "/></td> <td><div id=" Fktip "style=" width:300px "></div></ td> </tr> <tr> <td align= "right" > Pictures:</td> <td><input type= "text" id= " TP "style=" width:120px "/></td> <td><div id=" Tptip "style=" width:300px "></div></td > </tr> <tr> <td align= "Right" > Compressed file:</td> <td><input type= "text" id= " RAR "style=" width:120px "/></td> <td><div id= "Rartip" style= "width:300px" ></div></td> </tr> <tr> &LT;TD align= "Right" >ip4:</td> <td><input type= "text" id= "IP4" style= "width:120px"/></       td> <td><div id= "Ip4tip" style= "width:300px" ></div></td> </tr> <tr> &LT;TD align= "Right" >qq number:</td> <td><input type= "text" id= "QQ" style= "width:120px"/&GT;&LT;/TD&G      T <td><div id= "Qqtip" style= "width:300px" ></div></td> </tr> <tr> <td Alig N= "Right" > Domestic phone:</td> <td><input type= "text" id= "dh" style= "width:120px"/></td> <t D><div id= "Dhtip" style= "width:300px" ></div></td> </tr> <tr> <td align= "Ri Ght "> User name:</td> <td><input type=" text "id=" YHM "style=" width:120px "/></td> <td> <div id= "YHMTIP "style=" width:300px "></div></td> </tr> <tr> <td align=" right "> Alphabet: &LT;/TD&G      T <td><input type= "text" id= "ZM" style= "width:120px"/></td> <td><div id= "ZmTip" style= "Widt h:300px "></div></td> </tr> <tr> <td align=" right "> Capital letters:</td> <t D><input type= "text" id= "Dxzm" style= "width:120px"/></td> <td><div id= "DxzmTip" style= "width : 300px ></div></td> </tr> <tr> <td align= "right" > Small Letter:</td> <td ><input type= "text" id= "Xxzm" style= "width:120px"/></td> <td><div id= "XxzmTip" style= "width: 300px ></div></td> </tr> <tr> <td align= "right" > ID:</td> &LT;TD&G T;<input type= "text" id= "SFZ" style= "width:120px"/></td> <td><div id= "Sfztip" style= "width:300p X "&GT;&LT;/DIV&GT;</td> </tr> </table> 

jquery Form Validation

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.