Home html HTML RadioButton: several pieces

HTML RadioButton: several pieces

Author

Date

Category

I have in one form 6 of the radio clutches. How to divide them so that you can select 2 booton radio when choosing. Throw every 3 booton radio in different forms? Just that?


Answer 1, Authority 100%

something like this:

& lt; form name = "MyForm" Action = "MyFormHandler.cgi" Method = "POST" & gt;
& lt; Input Type = "Radio" name = "group1" value = "Milk" & gt; Milk & lt; br & gt;
& lt; Input Type = "Radio" name = "group1" value = "butter" Checked & gt; Butter & lt; br & gt;
& lt; Input Type = "Radio" name = "group1" value = "Cheese" & gt; Cheese
& lt; hr & gt;
& lt; Input Type = "Radio" name = "group2" value = "Water" & gt; Water & lt; br & gt;
& lt; Input Type = "Radio" name = "group2" value = "beer" & gt; Beer & lt; br & gt;
& lt; Input Type = "Radio" name = "group2" value = "Wine" Checked & gt; Wine & lt; br & gt;
& lt; / form & gt;

Otherwise, it will not work dynamically to dynamically, since the button must belong to the previously designated group. For arbitrary sample, use checkboxes – for this they are intended.

can be, depending on the setting of the task, – dynamically draw elements of the form and assign the necessary group to the desired radio button at the time of drawing to divide the items according to the specified groups in which the selection will be equal to only one selected item, but it is too impractical .


Answer 2, Authority 100%

http://jsfiddle.net/u5stz/

Meaning is that the buttons of the same group should have the same name.

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions