p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   HTML Code Clinic (http://p2p.wrox.com/forumdisplay.php?f=90)
-   -   radio-button (http://p2p.wrox.com/showthread.php?t=38979)

grstad February 24th, 2006 07:34 AM

radio-button
 
Hei!

Does a group of radio-buttons (they all ahve the same name) need to have one of then set to checked="checked"?
   And if so, can I have multiple groups of radio-buttons in the same form?

Regards from grstad


Dj Kat February 26th, 2006 09:51 AM

Hi,

Question number 1.
Correct me if I'm wrong. But do you mean that when you have check boxes that one always is checked by default. In that case the awnser is no. How ever in some situations it is very handy to have one checked by default for example when you work with a database and you don't want a empty value.

Question number 2.
If you have multiple questions and you like to awnser these with radiobuttons. All these questions can be awsered by radio buttons as long as thes groups have different names.

Let me know if this awsers your question

__________________________________________________ ________
This is my junk I'm gona eat it

grstad February 28th, 2006 08:20 AM

Hei!
1) I mean radio-buttons. Do one of the buttons in each group, need to be checked by default in order to function. All of the groups are in the samme form, sorting under the same submit-button with action set to some .asp-file. [:p]

2) Each group, different names - OK! [:I]

Regards grstad


meow February 28th, 2006 08:32 AM

It's recommended, yes.

"At all times, exactly one of the radio buttons in a set is checked. If none of the <INPUT> elements of a set of radio buttons specifies `CHECKED', then the user agent must check the first radio button of the set initially.

Since user agent behavior differs, authors should ensure that in each set of radio buttons that one is initially "on"."
http://www.w3.org/TR/html401/interact/forms.html#radio


--
http://yupapa.com


All times are GMT -4. The time now is 05:25 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.