Hi there,
You'll need to code this yourself. For a Text box, this is easy, as you probably found out:
' ASP Code
Dim TextBoxValue
TextBoxValue = Request.Form("MyTextBox")
' HTML Form
<input type="text" name="MyTextBox" value="<%=TextBoxValue%>">
For a drop-down, things are a bit more difficult. If you're using a program like Dreamweaver, you can have it automatically create the code for you. If you're doing it manually, you'll need something like this (taken from a Dreamweaver page). For each drop-down option element you want to display, you need to check whether the current Form value equals the value of the <option> element. If that's the case, you need to write out selected so the item appears selected in the browser:
Code:
<%@LANGUAGE="VBSCRIPT"%>
<html>
<head>
</head>
<body>
<form name="frmTest" method="post">
<select name="lstTest">
<option value="1" <%If (Not isNull(Request.Form("lstTest"))) _
Then If ("1" = CStr(Request.Form("lstTest"))) _
Then Response.Write("SELECTED") : _
Response.Write("")%>>Item 1</option>
<option value="2" <%If (Not isNull(Request.Form("lstTest"))) _
Then If ("2" = CStr(Request.Form("lstTest"))) _
Then Response.Write("SELECTED") : _
Response.Write("")%>>Item 2</option>
<option value="3" <%If (Not isNull(Request.Form("lstTest"))) _
Then If ("3" = CStr(Request.Form("lstTest"))) _
Then Response.Write("SELECTED") : _
Response.Write("")%>>Item 3</option>
</select>
<input name="btnSubmit" type="submit" value="Submit to Server">
<%
If Request.Form("lstTest") & "" <> "" Then
Response.Write("<br />Selected Item is " & _
Request.Form("lstTest"))
End If
%>
</form>
</body>
</html>
I split the code for the <option> elements over multiple lines using an underscore, but each <option> element could be on just one long line.
Just copy and paste the entire code block in a new ASP page. Run it in your browser, select an item and click the Submit button. You'll notice the item remains selected and the value of the selected item appears under the drop-down.
HtH,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.