Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying as a radio (rsCheckUser) 1

Status
Not open for further replies.

nk9100

Technical User
May 13, 2005
67
GB
Hi,

I have an input page of a large series of radio buttons, this inputs either 0,1,2 or 3 to the Db (Access), I am wondering how I can display this 0,1,2,3 back as a radio so it is then updateable?

I have seen a post which did this on here before, but have searched to no avail.

Can anyone help?

Cheers
Richard

Life is a journey that always ends up in the place
 
Suppose your HTML on the update page looks something like this:
<input type="radio" Name="MyField" id="r0" value="0">
<br>
<input type="radio" Name="MyField" id="r1" value="1">
<br>
<input type="radio" Name="MyField" id="r2" value="2">
<br>
<input type="radio" Name="MyField" id="r3" value="3">

You can use "checked" the same way that you would with checkboxes.

Now suppose you have an ADO recordset and suppose it contains one record. Suppose the record has one field and the value can be 0, 1, 2, or 3. You might have something like this:
<input type="radio" Name="MyField" id="r0" value="0" [highlight]<%If rs(0) = 0 Then Response.Write " checked "%>[/highlight]>
<br>
<input type="radio" Name="MyField" id="r1" value="1" [highlight]<%If rs(0) = 1 Then Response.Write " checked "%>[/highlight]>
<br>
<input type="radio" Name="MyField" id="r2" value="2" [highlight]<%If rs(0) = 2 Then Response.Write " checked "%>[/highlight]>
<br>
<input type="radio" Name="MyField" id="r3" value="3" [highlight]<%If rs(0) = 3 Then Response.Write " checked "%>[/highlight]>

 
Excellent!, Thanks again Sheco!

Life is a journey that always ends up in the place
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top