TNG wrote:
Hi,
Question, I use often a combo box on my ASP pages.
each time a form is submitted, the value of the combo box returns to
the first selection
But is there a way to avoid this and show always your latest
selection ?
Thx in advance
Here's one way:
<%
dim selection, options
selection=request.form("cmb")
options="<option value='a'>A</option><option value='b'>" & _
"B</option><option value='c'>C</option>"
if len(selection) > 0 then
options = replace(options,"value='" & selection & "'", _
"value='" & selection & "' selected")
end if
%>
<html>
<body>
<form method="post">
<select name="cmb">
<%=options%>
</select>
<input type="submit">
</form></body></html>
HTH,
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"