i need to design a form that will hold some required fields. I searched the forum for my prob but just got confused. So i m now posting my qs.
I've two files mainpg.htm and mail_info.asp. mainpg.htm holds the form (with few fields like company, email, address, phone etc.) which submits results to mail_info.asp. The email is the required field i.e. if the user submits the form without entering an email address, he should be re-directed back to mainpg.asp with a message appearing above the form "You must enter an email address before proceeding further". Moreover, the fields already entered should be retained i.e. the user don't have to start all over again.
Given below is is the code tht i m trying to work out.....
Mainpg.htm
===========
<form method="POST" action="mail_info.asp">
<table border="1" cellpadding="0" width="60%" >
<tr>
<td width="40%" bgcolor="#F2F2F2">
<font face="Verdana" size="1"> <b>Company</b></font></td>
<td width="60%" bgcolor="#FFFFFF">
<font size="1" face="Verdana"><input type="text" name="company"></font></td>
</tr>
<<tr>
<td width="40%" bgcolor="#F2F2F2">
<font face="Verdana" size="1"> <b>Email *</b></font></td>
<td width="60%" bgcolor="#FFFFFF">
<font size="1" face="Verdana"><input type="text" name="email"></font></td>
</tr>
.
.
.
</table>
Mail_info.asp
==========
<%
Dim strCompany
Dim strEmail
strCompany = Request.Form("Company")
strEmail = Request.Form("Email")
.
.
IF strEmail = "" THEN
Response.Redirect "mail_info.htm"
End If
.
.
.
.
Rest of the code...
I've two files mainpg.htm and mail_info.asp. mainpg.htm holds the form (with few fields like company, email, address, phone etc.) which submits results to mail_info.asp. The email is the required field i.e. if the user submits the form without entering an email address, he should be re-directed back to mainpg.asp with a message appearing above the form "You must enter an email address before proceeding further". Moreover, the fields already entered should be retained i.e. the user don't have to start all over again.
Given below is is the code tht i m trying to work out.....
Mainpg.htm
===========
<form method="POST" action="mail_info.asp">
<table border="1" cellpadding="0" width="60%" >
<tr>
<td width="40%" bgcolor="#F2F2F2">
<font face="Verdana" size="1"> <b>Company</b></font></td>
<td width="60%" bgcolor="#FFFFFF">
<font size="1" face="Verdana"><input type="text" name="company"></font></td>
</tr>
<<tr>
<td width="40%" bgcolor="#F2F2F2">
<font face="Verdana" size="1"> <b>Email *</b></font></td>
<td width="60%" bgcolor="#FFFFFF">
<font size="1" face="Verdana"><input type="text" name="email"></font></td>
</tr>
.
.
.
</table>
Mail_info.asp
==========
<%
Dim strCompany
Dim strEmail
strCompany = Request.Form("Company")
strEmail = Request.Form("Email")
.
.
IF strEmail = "" THEN
Response.Redirect "mail_info.htm"
End If
.
.
.
.
Rest of the code...