My form submits to the same page. Once the form is submitted and the page reloads, I want the value selected in the drop-down list, before the form was submitted, to be automatically selected.
Here's how I'm trying it, but it's not working. BTW, the drop down is being dynamically populated from a db...that part does work.
...and in the form, I have: <select size="1" name="Specialty"><%=prioritytypes%></select>
Any help is much appreciated. Thanks!
Here's how I'm trying it, but it's not working. BTW, the drop down is being dynamically populated from a db...that part does work.
Code:
strSQL = "SELECT specialty "
strSQL = strSQL & "FROM [Provider 2006] group by specialty"
oRs.Open strSQL, oConn, adOpenStatic, adLockReadOnly
WHILE NOT oRs.EOF
IF oRs("specialty") = sSpecialty THEN
prioritytypes = prioritytypes & "<option selected value=" & sSpecialty & ">" & sSpecialty & "</option>"
ELSE
prioritytypes = prioritytypes & "<option value=" & oRs("specialty") & ">" & oRs("specialty") & "</option>"
END IF
oRs.MoveNext
WEND
oRs.Close
oConn.Close
Any help is much appreciated. Thanks!