I am trying to retain the values of an input box after I check to see if all required fields have been filled. If they are not, I want to display the data that they have already typed, and let them finish the form. Here is the Code that I have:
...
<html>
ETC.....
<% if Request("error") = "yes" then %>
<p align="center"> <font color="#FF0000" size="4">Fields with * must be completed</font></td>
<% end if %>
<form method="post" action="submit.asp">
<tr>
<td width="50%" height="22" align="left">
<font face = "Arial" size="2">*First Name:</td>
<td width="50%" height="22" align="left">
<input type = "text" size = "30" name = "fname" tabindex="1" value="<%=Request.Form("fname")%>"></td>
</tr>
<tr>
<td width="50%" height="22" align="left">
<font face = "Arial" size="2">*Loan Number:</td>
<td width="50%" height="22" align="left">
<input type = "text" size = "30" name = "lname" tabindex="2" value="<%=Request.Form("lname")%>"></td>
</tr>
etc...
<%
If Request.Form("fname") = "" or _
Request.Form("lname") = "" or _
Response.Redirect "submit.asp?error=yes"
End if
etc...
When I get redirected back to the error page, the values that have been entered are gone. Is there a way that I can retain these values and let the user finish the form?
...
<html>
ETC.....
<% if Request("error") = "yes" then %>
<p align="center"> <font color="#FF0000" size="4">Fields with * must be completed</font></td>
<% end if %>
<form method="post" action="submit.asp">
<tr>
<td width="50%" height="22" align="left">
<font face = "Arial" size="2">*First Name:</td>
<td width="50%" height="22" align="left">
<input type = "text" size = "30" name = "fname" tabindex="1" value="<%=Request.Form("fname")%>"></td>
</tr>
<tr>
<td width="50%" height="22" align="left">
<font face = "Arial" size="2">*Loan Number:</td>
<td width="50%" height="22" align="left">
<input type = "text" size = "30" name = "lname" tabindex="2" value="<%=Request.Form("lname")%>"></td>
</tr>
etc...
<%
If Request.Form("fname") = "" or _
Request.Form("lname") = "" or _
Response.Redirect "submit.asp?error=yes"
End if
etc...
When I get redirected back to the error page, the values that have been entered are gone. Is there a way that I can retain these values and let the user finish the form?