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

Showing a radio button selected if value="whatever"

Status
Not open for further replies.

nk9100

Technical User
May 13, 2005
67
GB
Hi,

I am after some code, which i have seen on here somewhere, to allow me to display which ever radio button should be selected according to the value in the DB,

Can anyone help?

Life is a journey that always ends up in the same place
 
something like this:
Code:
mydropdown=rs("yourfield")
<select size="1" name="yourdropdown">
  <option value="val1" <% IF (mydropdown = "val1") THEN Response.Write " selected "%>>val1</option>
  <option value="val2" <% IF (mydropdown = "val2") THEN Response.Write " selected "%>>val2</option>
</select>
-DNG
 
Right, i see how it is altered

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

Part and Inventory Search

Sponsor

Back
Top