Create a global.asa file in the root of your web and dim some session variables in the Session_OnStart subroutine - e.g.
Sub Session_OnStart Dim Save_First Dim Save_Last End Sub |
In your registration page assign the value of each session variable to its respective form field - e.g.
<p> First Name: <input name="First" type="text" id="First" value="<%=Session("Save_First")%>"> Last Name: <input name="Last" type="text" id="Last" value="<%=Session("Save_First")%>"> </p> |
The first time through, each session variable will be blank
In your form handler (looks like it's form.asp), assign the contents of each form field to its respective session value.
Session("Save_First") = Trim(Request.Form("First")) Session("Save_Last") = Trim(Request.Form("Last")) |
You can do this either at the beginning of the form handler, or only if it fails validation. Now if you redirect back to the registration page, the value of each field will be populated with the session value.
I wrapped the form fields in the "Trim" function to remove leading and trailing spaces - also useful if the user just put in a space instead of valid content.