ASPProtect ( Click Here For More Details !!! )
Return To Home Page - Link to "The Wanker" - Contact Us




Return To Home Page

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

ASP (Active Server Pages) is a technology developed by Microsoft. Pages using ASP are primarily developed in JScript, or VBScript and are integrated into the HTML of your Web pages. The ASP code is compiled on-the-fly by the server and the resulting output is standard HTML. By using ASP, Web pages can be dynamic, full of ever-changing content, and browser independent.
vbscript active server pages ASP vbscript SQL database informix oracle SQL Server Perl CGI Delphi PHP source code code sample samples program 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,www.abay.com

 

Link to "The Wanker"
© 2007 CodeWanker - Active Server Pages Articles, Code Snippets, & Tutorials