Java Web Experiment register.jsp

Source: Internet
Author: User
Tags java web

<%@ page language= "java" contenttype= "text/html; Charset=utf-8 "%>
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "HTTP://WWW.W3.ORG/TR/HTML4/LOOSE.DTD" >
<script type= "Text/javascript" >
function On_submit ()
{//Verify the legality of the data
if (Form1.username.value = = "")
{
Alert ("User name cannot be empty, please enter user name!") ");
Form1.username.focus ();
return false;
}
if (Form1.userpassword.value = = "")
{
Alert ("The user password cannot be empty, please enter the password!") ");
Form1.userpassword.focus ();
return false;
}
if (Form1.reuserpassword.value = = "")
{
Alert ("The user confirms that the password cannot be empty, please enter the password!") ");
Form1.reuserpassword.focus ();
return false;
}
if (form1.userpassword.value! = form1.reuserpassword.value)
{
Alert ("Password differs from confirmation password");
Form1.userpassword.focus ();
return false;
}
if (form1.email.value.length!= 0)
{
for (i=0; i<form1.email.value.length; i++)
if (form1.email.value.charAt (i) = = "@")
Break
if (i==form1.email.value.length)
{
Alert ("Illegal email address! ");
Form1.email.focus ();
return false;
}
}
Else
{
Alert ("Please enter email! ");
Form1.email.focus ();
return false;
}
}
</script>
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 ">
<title> New User Registration </title>
<body>
<form method= "POST" action= "accept.jsp" Name= "Form1" onsubmit= "Return On_submit ()" >
New User Registration <br>
Username (*): <input type= "text" name= "username" size= "><br>"
Secret &nbsp; Code (*): <input type= "password" name= "UserPassword" size= "><br>"
Lose password Again (*): <input type= "password" name= "Reuserpassword" size= "><br>"
Gender: <input type= "Radio" value= "male" checked name= "sex" > Male <input type= "Radio" name= "Sex" value= "women" > Women <br>
Date of birth: <input name= "Year" size= "4" maxlength=4> years
<select name= "Month" >
<option value= "1" selected>1</option>
<option value= "2" >2</option>
<option value= "3" >3</option>
<option value= "4" >4</option>
<option value= "5" >5</option>
<option value= "6" >6</option>
<option value= "8" >7</option>
<option value= "9" >9</option>
<option value= "Ten" >10</option>
<option value= "One" >11</option>
<option value= ">12</option>"
</select> Month
<input name= "Day" size= "3" maxlength=4> <br>
e-Mail (*): <input name= "Email" maxlength=28><br>
Home Address: <input type= "text" name= "Address" size= "><br>"
<input type= "Submit" value= "commit" Name= "B1" ><input type= "reset" value= "Overwrite All" name= "B2" ><br>
</form>
</body>

Java Web Experiment register.jsp

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.