Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Radio Buttons/Option Group

Reply
Thread Tools

Radio Buttons/Option Group

 
 
Mokoena
Guest
Posts: n/a
 
      07-02-2003
How do I get radio buttons to work in HTML, so that only one in a group can
be selected at a time? How do I get the value returned from them? How do I
reference them in JavaScript? What value is returned?

Muchos Gracias.


 
Reply With Quote
 
 
 
 
Steve Pugh
Guest
Posts: n/a
 
      07-02-2003
"Mokoena" <(E-Mail Removed)> wrote:

>How do I get radio buttons to work in HTML, so that only one in a group can
>be selected at a time?


Give them all the same name.

>How do I get the value returned from them?


Include the appropriate URI in the action attribute of the form.

>How do I reference them in JavaScript?


document.forms[i].elements[i]
or
document.formname.elementname
or
document.getElementById("id")

>What value is returned?


name=value

So,
<input type="radio" name="cheese" value="cheddar">
<input type="radio" name="cheese" value="stilton
<input type="radio" name="cheese" value="brie">
<input type="radio" name="cheese" value="roquefort">

Will on submission of the form return cheese=stilton if the second
radio button is selected.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <(E-Mail Removed)> <http://steve.pugh.net/>
 
Reply With Quote
 
 
 
 
brucie
Guest
Posts: n/a
 
      07-02-2003
In post <(E-Mail Removed)>
Steve Pugh said...

> <input type="radio" name="cheese" value="cheddar">
> <input type="radio" name="cheese" value="stilton
> <input type="radio" name="cheese" value="brie">
> <input type="radio" name="cheese" value="roquefort">


http://www.intriguing.com/mp/_sounds/lb/cheese.wav

--
brucie a. blackford. 02/July/2003 08:02:26 pm kilo.
http://loser.brucies.com/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[OT: How to broadcast an internet radio on a real radio world wide?] Jan C. Faerber HTML 0 06-30-2009 08:05 AM
ASP.NET Reset Radio Button in a group of Radio Buttons Scott D Johnson ASP .Net 1 09-27-2006 10:38 PM
Radio button List problem: How to find value of Radio button list's Selected Item using javascript?? Hiten ASP .Net Web Controls 1 05-26-2004 10:32 AM
Radio Button Group Ken Saganowski ASP .Net 2 01-25-2004 03:32 PM
how to make a group of dynamicaly radio buttons Bisser Milanov ASP .Net 2 06-26-2003 08:01 PM



Advertisments