Hi there,
On post back, simply retrieve the values from the Form, store them in variables and display them again. Below you'll find a simple example:
Code:
<%
Dim FirstName
Dim LastName
FirstName = Request.Form("txtFirstName")
LastName = Request.Form("txtLastName")
' At this point, when the page first loads
' both variables will be empty
' However, when the form has been submitted
' these two variables will be filled with the values
' from their accompanying form fields
%>
...
<form name="frmUser" action="SelfSubmittingPage.asp" method="post">
<input type="text" name="txtFirstName" value="<%=FirstName%>">
<input type="text" name="txtLastName" value="<%=LastName%>">
<input type="submit" name="btnUpdate" value="Update">
</form>
No matter how many times the user presses the
Update button, the form fields will keep their values.
You'll need to code the difference between the
Update, and let's say, a
Save button.
Update just shows the new values, while the
Save button actually does something with those values. You can code something like this for that:
Code:
<%
If Request.Form("btnUpdate") <> "" Then
' Update button pressed. Do something and
' display form again
End If
If Request.Form("btnSave") <> "" Then
' Save button pressed. Do something more useful,
' like saving the values to a database and redirect
End If
%>
Hope this helps,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.