Home | Advertising Info24 USERS CURRENTLY ONLINE   
   Site Search Contact Us Wednesday, January 22, 2020  

Forms - Populating radio buttons with info from a database

Below is an example of populating radio buttons from a field in your database.

This is just an example.. when doing this for real you would do a query to determine the existing values for all the form fields... for this example we will populate the variable ourselves with one of 3 possible values..  "Extra Cheese" , "Pepperoni" , or "Sausage".

Topping1 = "Pepperoni"

<div align="center"><center><table border="0">
<td colspan="2" align="center">Topping 1</td>
<td><input type="radio" value="Extra Cheese" name="Topping1"
<% If Topping1 = "Extra Cheese" Then Response.Write(" checked") %>></td>
<td>Extra Cheese</td>
<td><input type="radio" value="Pepperoni" name="Topping1"
<% If Topping1 = "Pepperoni" Then Response.Write(" checked") %>></td>
<td><input type="radio" value="Sausage" name="Topping1"
<% If Topping1 = "Sausage" Then Response.Write(" checked") %>></td>

And this is what the output would look like if the field had the value "Pepperoni".

Topping 1
Extra Cheese

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright 1998 - 2020 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

Active Server Pages asp source code database MS SQL MS Access .mdb adovbs.inc cookies calendar codes sql commands scripts asp programming tutorials iis web server components CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspclassifieds.com, www.powerasp.com,www.cjwsoft.com,www.aspphotogallery.com,www.codewanker.com,www.aspprotect.com,www.aspbanner.com