I assume that you are not posting back to the same page, huh? You can use
session variables then, as such. You could also use a querystring, but I
find that to get messy and less than ideal. Here's a simple example:
page1.asp:
<%
Dim aErrors(1)
aErrors(0) = ""
aErrors(1) = "Your username may not contain a space."
sUsername = Session("Username")
Session.Contents.Remove("Username")
iErrorID = CInt(Request.Querystring("e"))
%>
<form method="post" action="page2.asp">
<table>
<% If iErrorID > 0 Then %>
<tr>
<td colspan="2"><%=aErrors(iErrorID)%></td>
</tr>
<% End If %>
<tr>
<td>Pick a username</td>
<td><input name="txtUsername" type="text" value="<%=sUsername%>" />
</tr>
<tr>
<td colspan="2" align="right"><input type="submit" /></td>
</tr>
</table>
</form>
page2.asp:
<%
Dim sUsername
sUsername = Trim(Request.Form("txtUsername"))
If Instr(sUsername, " ") > 0 Then
Session("Username") = sUsername
Response.Redirect "page1.asp?e=1"
Else
Session.Contents.Remove("Username")
Response.Write "The username that you entered, " & sUsername & " does not
contain any spaces. Good job."
End If
%>
Ray at home
"Stewart" <st************@hp.com> wrote in message
news:00****************************@phx.gbl...
Hello I hope someone can help me.
I have a form page a user needs to fill out. I want to be
able to send the user back to the form once it is
submitted and an error in processing occurs, for example
if they have an illigal charcter in the form somewhere.
The whole form wouldn't need to be retyped, just the
field in question.
How can I send the user back to the form they just
submitted to correct an entry?