Setting Value of Option Button

R

RobA

Hi,

I am retreiving the value of a field from a sql database using a recordset

<%
DIM RobjRS, RstrSQL, ID, RQID
ID = Session("ID")
RQID = "CM01"

strSQL = "SELECT iauID, QID, ascore FROM iaVals "
strSQL = strSQL & " WHERE iauID = " & ID & " AND QID = '" & RQID & "'"

Set RobjRS = objConn.Execute (strSQL)

Function fixQuotes(strData)
fixQuotes = Replace(strData,"'","''")
End Function
%>

This works fine, but I have an Option Button consisting of 5 values and I
would like to display the value as selected that corresponds to the value
returned by the recordset.

I am unsure where to put the code so the option is checked when the value
matches the recordset value.

Any help would be greatly appreciated.

Rob
 
R

RobA

Please disregard, I worked it out.

<input type="radio" value="20" name="Value" <% If RobjRS("aScore")="20"
Then response.write" checked"%>>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top