Any help is much appreciated.
<%IF rs_data("Option") = x then Response.Write("Selected")%>
You'll have to put that on every option possibility.
-g
Sub doDropDownMatch(sql,sSelect,iMatch,oConn)
Dim rsDDL, arrDDL, dloop
Set rsDDL = oConn.execute(sql)
Response.Write "<select name=""" & sSelect & """>" & vbcrlf
Response.Write "<option></option>" & vbcrlf
If Not rsDDL.EOF Then
arrDDL = rsDDL.Getrows()
rsDDL.Close : Set rsDDL = Nothing
For dloop = 0 to Ubound(arrDDL,2)
Response.Write "<option value=""" & arrDDL(0,dloop) & """"
If IsNumeric(iMatch) Then
If Clng(arrDDL(0,dLoop)) = Clng(iMatch) Then Response.Write "
selected=""selected"""
End If
Response.Write ">" & arrDDL(1,dloop) & "</option>" & vbcrlf
Next
Else
rsDDL.Close : Set rsDDL = Nothing
End If
Response.Write "</select>"
End Sub
You'd just pass in the following arguments: the SQL that needs to be
executed, the html name attribute you want to give the Select element, the
(integer) value you want to match, and an open connection object.
--
Mike Brind
MVP - ASP/ASP.NET
"Phil Grimpo" <pgr...@inspirmedia.com> wrote in message
news:48C593DF...@inspirmedia.com...
Here's the original code:
<input name="Child_YCSDPreviousEnrolled"
id="Child_YCSDPreviousEnrolled" type="radio" value="Yes" />Yes
<input name="Child_YCSDPreviousEnrolled"
id="Child_YCSDPreviousEnrolled" type="radio" value="No" />No
///////////////////////////////////////
So it would be changed to this:
<input name="Child_YCSDPreviousEnrolled"
id="Child_YCSDPreviousEnrolled" type="radio" value="<%IF
rs_Student("Option") = Yes then Response.Write("Selected")%>" />Yes
<input name="Child_YCSDPreviousEnrolled"
id="Child_YCSDPreviousEnrolled" type="radio" value="<%IF
rs_Student("Option") = No then Response.Write("Selected")%>" />No