Example Forms - Course Registration

Submitted by Karthikeyan on Sun, 19/08/2012 - 19:01

File 1 : register.html


<HTML>
<HEAD>
</HEAD>
<BODY bgcolor="blue" text="white">
<form name="frmfree" method="post" action="reply.asp">
<TABLE WIDTH=75% BORDER=2 CELLSPACING=1 CELLPADDING=1 ALIGN = "CENTER">
	<TR>
	<CENTER>
		<FONT face=fantasy size=10>COURSE REGISTRATION		</FONT></CENTER>
	</TR>
	<TR>
		<TD>APPLICANT NAME</TD>
		<TD><INPUT TYPE=TEXT NAME=APPNAME SIZE=30></TD>
	</TR>
	<TR>
		<TD>ADDRESS</TD>
		<TD><INPUT TYPE=TEXT NAME=APPADD SIZE=30></TD>
	</TR>
	<TR>
		<TD>SELECT COURSE</TD>
		<TD>
<SELECT CASE NAME="SECOURSE"><BR>
<OPTION VALUE=1>C
<OPTION VALUE=2>CPP
<OPTION VALUE=3>JAVA
<OPTION VALUE=4>J2EE
<OPTION VALUE=5>.NET
</SELECT>
		</TD>
	</TR>
	<TR>
		<TD>TRACK</TD>
		<TD><INPUT NAME=TRACK TYPE=RADIO VALUE=1>SLOW TRACK     <INPUT NAME=TRACK TYPE=RADIO VALUE=2>FAST TRACK</TD>
	</TR>
	<TR>
	<td></td>
		<TD><CENTER><INPUT NAME=BUTTON1 TYPE=SUBMIT VALUE="SUBMIT"></CENTER>		</TD>
	</TR>
</TABLE>



<P> </P>

</BODY>
</HTML>

File 2 : reply.asp


<%@ Language=VBScript %>
<% 
IF Request.Form("TRACK") = 1 THEN 
				TR = "1" 
				ELSE 
				TR = "2"
				END IF

SELECT CASE Request.Form("SECOURSE")
				CASE "1"
					COURSE = "C"
					FEES = 2000
					IF TR = "1" THEN
					DURATION = "2 MONTHS"
					ELSE
					DURATION = "1 MONTH"
					END IF
				CASE "2"
					COURSE = "C++"
					FEES = 3500
					IF TR = "1" THEN
					DURATION = "3 MONTHS"
					ELSE
					DURATION = "1 MONTH"
					END IF
				CASE "3"
					COURSE = "JAVA"
					FEES = 4500
					IF TR = "1" THEN
					DURATION = "4 MONTHS"
					ELSE
					DURATION = "2 MONTHS"
					END IF
				CASE "4"
					COURSE = "J2EE"
					FEES = 5000
					IF TR = "1" THEN
					DURATION = "6 MONTHS"
					ELSE
					DURATION = "3 MONTHS"
					END IF
				CASE "5"
					COURSE = ".NET"
					FEES = 5500
					IF TR = "1" THEN
					DURATION = "6 MONTHS"
					ELSE
					DURATION = "3 MONTHS"
					END IF
				END SELECT %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY bgcolor=OliveDrab text=White>
<TABLE width=500 BGCOLOR=ForestGreen ALIGN=center BORDER=2 CELLSPACING=1 CELLPADDING=2 bordercolorlight=Fuchsia bordercolordark=Aqua>
	<TR>
		<TD>NAME OF THE CANDIDATE</TD>
		<TD><% =Request.Form("APPNAME")%></TD>
	</TR>
	<TR>
		<TD>ADDRESS FOR COMMUNICATION</TD>
		<TD><% =Request.Form("APPADD")%></TD>
	</TR>
	<TR>
		<TD>TRACK</TD>
		<TD>  <%IF TR = "1" THEN 
				Response.Write("SLOW")
				ELSE 
				Response.Write("FAST") 
				END IF%>
		</TD>
	</TR>
	<TR>
		<TD>SELECTED COURSE</TD>
		<TD>
			<% =Response.Write(COURSE)%>
		</TD>
	</TR>
	<TR>
		<TD>FEES</TD>
		<TD><% =Response.Write(FEES)%></TD>
	</TR>
	<TR>
		<TD>DURATION</TD>
		<TD><% =Response.Write(DURATION)%></TD>
	</TR>
	</TABLE>
</BODY>
</HTML>