Home | Advertising Info227 USERS CURRENTLY ONLINE   
PowerASP
   Site Search Contact Us Sunday, March 16, 2025  


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"
%>

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

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

Topping 1
Extra Cheese
Pepperoni
Sausage

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright © 1998 - 2025 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 what is asp programming how to sample asp example code scripts software asp forum mail sessions applications global.asa 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