This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > FrontPage Programming > December 2005 > Setting Value of Option Button





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Setting Value of Option Button
RobA

2005-12-17, 6:22 am

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


RobA

2005-12-17, 6:52 pm

Please disregard, I worked it out.

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


"RobA" <anon@robsbiz.com> wrote in message
news:1RRof.945$r4.21@newsfe1-gui.ntli.net...
> 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
>



Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews