stephenmbell
IS-IT--Management
I am populating a combo box with values from a recordset. My select box load fine, receives the proper data. I am trying to submit to the form any number in the select box and post to itself with the proper value selected. My condition never evaluates the if..it is always the else..
why?
Thanks
why?
Thanks
Code:
<select name="cboShop" id="cboShop" onchange="document.form.submit()">
<%
Dim rsShops, strSQL
strSQL = "select num from shops order by num asc"
set rsShops = fnGetRecordset(strSQL)
Do Until rsShops.EOF
If rsShops.Fields("num").value = Request.Form("cboShop") Then
' Response.write("S rec: " & rsShops("num").value & " url: " & Request.Form("cboShop") & vbcrlf)
Response.Write("<option selected>" & rsShops("num").value & "</option>")
Else
'Response.write("rec: " & rsShops("num").value & " url: " & Request.Form("cboShop") & vbcrlf)
Response.Write("<option>" & rsShops("num").value & "</option>")
End If
rsShops.movenext
Loop
rsShops.Close
set rsShops = Nothing
%>
</select>