ASP Introductory Tutorials-A comprehensive example of a form

Source: Internet
Author: User
Tags reset

Below we use a registration form to apply the controls commonly used in the form.

1, the Registration Form page code: (login.htm)

<HTML>
<HEAD><TITLE> Registration Form </TITLE>
<style type= "Text/css" >
<!--
body,td,th {
font-size:11pt;
Color: #009999;
line-height:1.5;
}
Body {
Background-color: #ffffff;
margin-top:0px;
margin-bottom:0px;
}
a:link {
Color: #0000FF;
Text-decoration:none;
}
a:visited {
Text-decoration:none;
Color: #0000FF;
}
a:hover {
Text-decoration:underline;
Color: #FF0000;
}
a:active {
Text-decoration:none;
}
. style2 {color: #0000FF}
. style4 {color: #FF0000}
-->
</style>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "></HEAD>
<body background= "4.jpg" >
<br><br><br><br><br><br>
<form name= "Form1" method= "Post" action= "show.asp" >
<table width= "580" border= "2" align= "center" bgcolor= "#b5b5b4" >
<tr bgcolor= "#000066" height= ">"
&LT;TD colspan= "2" align= "center" ><font color= "#fffff" ><b> please register </b></font></td>
</tr>
<tr height= ">"
&LT;TD align= "Center" > Name:
<input type= "text" name= "name" ></td>
&LT;TD align= "center" > Password:
<input type= "password" name= "password" ></td>
</tr>
&LT;TR height= align= "center" >
<td> male:
<input type= "Radio" name= "Gender" value= "male" checked>
Woman:
<input type= "Radio" name= "Gender" value= "female" ></td>
<td> Education: &nbsp;&nbsp;&nbsp;<select name= "Education" style= "width:156px" >
<option value= "Junior High School" > Junior High School
<option value= "High School" > High School
<option value= "secondary School" > Secondary School
<option value= "College" > College
<option value= "undergraduate" selected> undergraduate
<option value= "Postgraduate" > graduate student
<option value= "PhD" > PhD
</select></td>
</tr>
&LT;TR height= align= "center" >
&LT;TD colspan= "2" >
<input type= "checkbox" name= "hobby" value= "reading" > Reading &nbsp;
<input type= "checkbox" name= "Hobby" value= "outing" > Outing &nbsp;
<input type= "checkbox" name= "Hobby" value= "Dancing" > Dancing &nbsp;
<input type= "checkbox" name= "hobby" value= "singing" > Singing &nbsp;
<input type= "checkbox" name= "hobby" value= "watching news" > Watching news &nbsp;
<input type= "checkbox" name= "hobby" value= "Party" > Party &nbsp;
</td>
</tr>
<tr>
&LT;TD colspan= "2" >
<font color= "Red" ><b>&nbsp;&nbsp; your favorite maxim:</b></font>
<p> <textarea name= "Maxim" rows= "6" cols= "to" >&nbsp;&nbsp;&nbsp;&nbsp; the world to learn, to understand, there are too many things to know , and the person is not versatile, so I am the principle of being a person: never laugh at those who are weaker than themselves in some aspect. </textarea></td>
</tr>
<tr>
&LT;TD colspan= "2" align= "Center" >
<input type= "Submit" Name= "submitted" value= "Submit" >&nbsp;
<input type= "reset" name= "reset" value= "reset" >
</td>
</tr>
</table>
</form>
</body>
</HTML>
2, Information display page (show.asp)
<HTML>
<HEAD><TITLE> Registration Form </TITLE>
<style type= "Text/css" >
<!--
body,td,th {
font-size:11pt;
Color: #009999;
line-height:1.5;
}
Body {
margin-top:0px;
margin-bottom:0px;
}
a:link {
Color: #0000FF;
Text-decoration:none;
}
a:visited {
Text-decoration:none;
Color: #0000FF;
}
a:hover {
Text-decoration:underline;
Color: #FF0000;
}
a:active {
Text-decoration:none;
}
. style2 {color: #0000FF}
. style4 {color: #FF0000}
-->
</style>
<body background= "4.jpg" >
<br><br><br><br><br><br>
<%
Dim name,ps,sex,schoolage,like1,adage
Name=request.form ("name")
Ps=request.form ("password")
Sex=request.form ("Gender")
If sex= "male" then
sex= "Handsome"
Else
Sex= "Bright Sister"
End If
Schoolage=request.form ("Education")
Like1=request.form ("hobby")
Adage=request.form ("Maxim")
%>
<center>
<table border= "2" width= ">"
<tr>
<th colspan= "2" bgcolor= "#009966" ><font color= "#ffffff" > Your information is as follows:</font></th>
</tr>
&LT;TR align= "center" height= "valign=" Middle "bgcolor=" "#FFFFFF" >
&LT;TD aling= "center" >
Welcome to <%=name%><%=sex%> 's visit!<p>
Your hobby is: <%=like1%><p>
Your education is: <%=schoolage%><p>
Your password is: <%=ps%><p>
<table>
<tr><th><font color= "Red" > Your motto is:</font><p></th></tr>
<tr>
<td>
<%=adage%>
</td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</body>
</HTML>

See the full set of ASP Getting started tutorials

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.