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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to show radio button toggeld from database info on Update Page? 1

Status
Not open for further replies.
Jul 13, 2001
180
US
Hello.

I have an update page( form ) where the client can make changes to the info they have entered into a database.
One of the fields is a radio button group selection.

How do I populate the correct radio button from the database info, so they can see what the present choice was and can change it right there if needed to by clicking on another radio button.

Thanks in advance. :)
 
Something along these lines will do the trick:


<input type="radio" name="field1" value="value1" <% If rs("field1") = "value1" Then %>selected<% End If %>>

<input type="radio" name="field1" value="value2" <% If rs("field1") = "value2" Then %>selected<% End If %>>

<input type="radio" name="field1" value="value3" <% If rs("field1") = "value3" Then %>selected<% End If %>>>



Nick (Webmaster)

info@npfx.com
 
Hello, yyou set me toward the right direction, thank you.
However, for some reason, theh rest of the fields under the radio buttons now do not populate from the database,but the ones before it do.

Why's that?

Thanks again.
 
Found the cause!
For soem reason the code I have was extracting the fields from the database in the order of the columns, the one abovce being the last. I made it first and it worked fine!
Is there a parameter that restricts/unrestricts the order data is extracted from a databse?

Thank you so very much again!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top