Web Hosting Directory | Web Hosting Resources | Webmaster Resources | Domain Tools | Search Engine Marketing | Forums
  Signup
Today: 243   Yesterday: 1,303   Max: 2,773   Total: 530,576   Current Users : 17 (Member 0) 
DOMAIN TOOLS

WEBMASTER TOOLS

RELATED ARTICLES

SUBMIT AN ARTICLE

Write for us and get publicity, link to your website, and best of all get paid. Please visit our writers page for details.


LINK TO US

Link to us and earn points for each visitor you bring to us. Please visit our link partner page for details.

 

TYPE = RADIO

RADIO is used to create a series of choices of which only one can be selected. The term "radio button" comes from the buttons for the radio in an automobile, where selecting one radio station automatically de-selects all the others. HTML radio buttons are created by using several <INPUT TYPE=RADIO> buttons, all with the same name, but with different values. For example, this series of buttons allows you to choose one size for a pizza:

this code produces this
<FORM ACTION="../cgi-bin/mycgi.pl">
What size pizza?<P>

<INPUT TYPE=RADIO NAME="pizzasize" VALUE="S">small<BR>
<INPUT TYPE=RADIO NAME="pizzasize" VALUE="M">medium<BR>
<INPUT TYPE=RADIO NAME="pizzasize" VALUE="L">large<P>

<INPUT TYPE=SUBMIT VALUE="submit">
</FORM>
What size pizza?

small
medium
large

Note that it is the content of the VALUE attribute that is sent to the CGI, not whatever text happens to appear next to the radio button.

If one of the items should be the default selection, use the CHECKED attribute:

this code produces this
<FORM ACTION="../cgi-bin/mycgi.pl">
What size pizza?<P>

<INPUT TYPE=RADIO NAME="pizzasize" VALUE="S"         >small<BR>
<INPUT TYPE=RADIO NAME="pizzasize" VALUE="M" CHECKED >medium<BR>
<INPUT TYPE=RADIO NAME="pizzasize" VALUE="L"         >large<P>

<INPUT TYPE=SUBMIT VALUE="submit">
</FORM>
What size pizza?

small
medium
large

If no CHECKED attribute is used, different browsers have different ways of displaying the initial state of a series of radio buttons. Netscape and MSIE have none of the buttons selected. Mosaic selects the first button.



Copyright 1997-2002 Idocs, Inc. Written by Miko Sullivan.

 
 
 
What is your major source of website traffic?
 
 
 
 
 
 

ADVERTISEMENT

 
Cheap Web HostingBudget Web HostingEcommerce Web Hosting
Link to UsLink ExchangeAdvertisePrivacy PolicyTerms Of ServiceAbout UsContact UsSitemap
Copyright © 2006 - 2009 Broadband Media, Inc. All rights reserved.