RADIO BUTTON group

来源:互联网 发布:网络文明主题班会ppt 编辑:程序博客网 时间:2024/05/19 18:45

 SETTINGS:

Below is a listing of valid settings for radio buttons:


HTMLEXPLANATIONEXAMPLE
radio
  name=
  value=
  align=
  tabindex=
checked

Choose one - and only one - option
Name of the group.
Value that is submitted if checked.
Alignment of the field.
Tab order of the field.
Default check this field.




The name setting tells which group of radio buttons the field belongs to. When you select one button, all other buttons in the same group are unselected.
If you couldn't define which group the current button belongs to, you could only have one group of radio buttons on each page.

The value setting defines what will be submitted if checked.

The align setting defines how the field is aligned.
Valid entries are: TOP, MIDDLE, BOTTOM, RIGHT, LEFT, TEXTTOP, BASELINE, ABSMIDDLE, ABSBOTTOM.
The alignments are explained in the image section. You can learn about the different alignments here.

The tabindex setting defines in which order the different fields should be activated when the visitor clicks the tab key.




AN EXAMPLE:

Look at this HTML example:
<html>
<head>
<title>My Page</title>
</head>
<body>
<form name="myform" action="http://www.mydomain.com/myformhandler.cgi" method="POST">
<div align="center"><br>
<input type="radio" name="group1" value="Milk"> Milk<br>
<input type="radio" name="group1" value="Butter" checked> Butter<br>
<input type="radio" name="group1" value="Cheese"> Cheese
<hr>
<input type="radio" name="group2" value="Water"> Water<br>
<input type="radio" name="group2" value="Beer"> Beer<br>
<input type="radio" name="group2" value="Wine" checked> Wine
<br>
</div>
</form>
</body>
</html>


And the resulting output:



Milk
Butter
Cheese
Water
Beer
Wine


原创粉丝点击