Complete Form Verification Application

Source: Internet
Author: User

The form issue is a tangle of issues. I think this is something that programmers are going to handle, but sometimes the program is going to process it at the front end. What about your background partner? It's a tough front-end, but it's better to know yourself. You can also do it if you do it. You can do it if you don't do it, haha. If it is useful to you, please leave a message, discuss it together, make progress together, talk nonsense, and paste code (for the convenience of children's shoes, copy this code and use it without the need to piece it together ):


[Html]
<! Doctype html>
<Html>
<Head>
<Title> complete Form Verification Application </title>
<Style type = "text/css">
. Leftside {width: 100px; text-align: right; float: left ;}
Label. error {color: # ea5200; margin-left: 4px; padding: 0px 20px; background: url (http://www.bkjia.com/uploadfile/2013/0329/20130329030938719.gif) no-repeat 2px 0}
Label. right {margin-left: 4px; padding-left: 20px; background: url (http://www.bkjia.com/uploadfile/2013/0329/20130329030938664.gif) no-repeat 2px 0}
</Style>
<Script type = "text/javascript" src = "http://jt.875.cn/js/jquery.js"> </script>
<Script type = "text/javascript" src = "http://jt.875.cn/js/jquery.validate.js"> </script>
<Script type = "text/javascript">
$ (Function (){
$ ("# RegForm"). validate ({
Rules :{
// Register the user name
Username :{
Required: true,
Minlength: 5,
Maxlength: 12
},
// Email
Email :{
Required: true,
Email: true
},
// Password
Password :{
Required: true,
Minlength: 6,
Maxlength: 18
},
// Confirm the password
Confirm_password :{
Failed to: "# password"
},
// Verify the verification code
Captcha :{
Required: true,
Remote: "checkCaptcha. php"
}
},
Messages :{
// Register the user name
Username :{
Required: "This item cannot be blank ",
Minlength: "cannot be less than five characters ",
Maxlength: "cannot exceed 12 characters"
},
// Email
Email :{
Required: "This item cannot be blank ",
Email: "Incorrect email format"
},
// Password
Password :{
Required: "This item cannot be blank ",
Minlength: "cannot be less than 6 characters ",
Maxlength: "cannot exceed 18 characters"
},
// Confirm the password
Confirm_password: "The two passwords are inconsistent ",
// Verify the verification code
Captcha :{
Required: "Enter the verification code ",
Remote: "Incorrect verification code"
}
}
});
 
});
</Script>
</Head>
<Body>
<Form id = "regForm" method = "get" action = "">
<P> <label class = "leftside"> Name: </label> <input type = "text" value = "" name = "username" id = "username"/> </p>
<P> <label class = "leftside"> password: </label> <input type = "password" value = "" name = "password" id = "password"/> </p>
<P> <label class = "leftside"> confirm the password: </label> <input type = "password" value = "" name = "confirm_password" id = "confirm_password"/> </p>
<P> <label class = "leftside"> EMAIL: </label> <input type = "text" value = "" name = "email" id = "email"/> </p>
</Form>
 
</Body>
</Html>

<! Doctype html>
<Html>
<Head>
<Title> complete Form Verification Application </title>
<Style type = "text/css">
. Leftside {width: 100px; text-align: right; float: left ;}
Label. error {color: # ea5200; margin-left: 4px; padding: 0px 20px; background: url (http://www.bkjia.com/uploadfile/2013/0329/20130329030938719.gif) no-repeat 2px 0}
Label. right {margin-left: 4px; padding-left: 20px; background: url (http://www.bkjia.com/uploadfile/2013/0329/20130329030938664.gif) no-repeat 2px 0}
</Style>
<Script type = "text/javascript" src = "http://jt.875.cn/js/jquery.js"> </script>
<Script type = "text/javascript" src = "http://jt.875.cn/js/jquery.validate.js"> </script>
<Script type = "text/javascript">
$ (Function (){
$ ("# RegForm"). validate ({
Rules :{
// Register the user name
Username :{
Required: true,
Minlength: 5,
Maxlength: 12
},
// Email
Email :{
Required: true,
Email: true
},
// Password
Password :{
Required: true,
Minlength: 6,
Maxlength: 18
},
// Confirm the password
Confirm_password :{
Failed to: "# password"
},
// Verify the verification code
Captcha :{
Required: true,
Remote: "checkCaptcha. php"
}
},
Messages :{
// Register the user name
Username :{
Required: "This item cannot be blank ",
Minlength: "cannot be less than five characters ",
Maxlength: "cannot exceed 12 characters"
},
// Email
Email :{
Required: "This item cannot be blank ",
Email: "Incorrect email format"
},
// Password
Password :{
Required: "This item cannot be blank ",
Minlength: "cannot be less than 6 characters ",
Maxlength: "cannot exceed 18 characters"
},
// Confirm the password
Confirm_password: "The two passwords are inconsistent ",
// Verify the verification code
Captcha :{
Required: "Enter the verification code ",
Remote: "Incorrect verification code"
}
}
});

});
</Script>
</Head>
<Body>
<Form id = "regForm" method = "get" action = "">
<P> <label class = "leftside"> Name: </label> <input type = "text" value = "" name = "username" id = "username"/> </p>
<P> <label class = "leftside"> password: </label> <input type = "password" value = "" name = "password" id = "password"/> </p>
<P> <label class = "leftside"> confirm the password: </label> <input type = "password" value = "" name = "confirm_password" id = "confirm_password"/> </p>
<P> <label class = "leftside"> EMAIL: </label> <input type = "text" value = "" name = "email" id = "email"/> </p>
</Form>

</Body>
</Html>

Related Article

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.