Form submission Verification

Source: Internet
Author: User
Tags email account

Form juery verification in MVC

<SCRIPT type = "text/JavaScript">
$ (). Ready (function (){
$ ("# Frmreg"). Validate (
{
Errorelement: "Reg",/* plug-in will automatically generate a label after the text box and mark it as 'reg '. In this way, you can use Reg. success {} to control the style, remember Reg. do not leave spaces between success */
Success: function (Label ){
Label. Text (""). addclass ("success ");
},
Rules :{
Username :{
Required: True,
Minlength: 2,
Maxlength: 16
},
Email: {required: True, email: true },
Password :{
Required: True,
Minlength: 6,
Maxlength: 16
},
Confirmpassword: {required: True, failed to: "# password "},
Validate: {required: true}

}
}
);
});
</SCRIPT>

HTML code:
<Form action = "/account/register" method = "Post" id = "frmreg">
<Div class = "Left">
<Div class = "leadinfo"> enter the following information, all required: </div>
<Div class = "userinput">
<Ul class = "userinfo">
<Li> <SPAN class = "label"> account: </span> <input name = "username" id = "username" Title = "Both Chinese and English can contain no more than 8 Chinese characters or 16 characters"/> </LI>
<Li> <SPAN class = "label"> email account: </span> <input name = "email" id = "email" Title = "Please input email"/> </LI>
<Li> <SPAN class = "label"> logon password: </span> <input type = "password" name = "password" id = "password" Title = "Enter 6 to 16 digits or letters"/> </LI>
<Li> <SPAN class = "label"> Reset the password: </span> <input type = "password" name = "confirmpassword" id = "confirmpassword" Title = "repeat the above password"/> </LI>
<Li>
<Div> <SPAN class = "label"> Verification Code: </span> <input name = "Validate" id = "Validate" Title = "Enter the number in the image below"/> </div>
<Br/> <SPAN class = "moreinfo"> cannot see <a href = "javascript: refresh_captcha ()"> click here to refresh </a> </span>

</LI>
</Ul>
</Div>
<Div class = "c_gray" align = "center"> email account and nickname cannot be modified after registration. Check carefully. </Div> <br/>
<Div class = "useraction">
<Input name = "Submit" id = "Submit" type = "Submit" value = "complete registration" tabindex = "7" class = "btnnormal"/>
<Input type = "reset" id = "reset" value = "Refill" tabindex = "8" class = "btnnormal"/>
</Div>
<Div class = "leadinfo"> registered, <% = html. actionlink ("Log on", "Logon") %> </div>

<Input type = 'did' name = "gender" value = "-1"/>
<Input type = 'did' name = "city" value = "35"/>
<Input type = 'siden' name = "cburl" value = ""/>
</Div>
</Form>

<! -V: 3.2 -->

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.