|
The NAME and VALUE attributes are
essential and allow you to specify the name and value portion of
the name/value pair that is sent as part of the URL-encoded
string. For example, consider the following radio buttons:
Here is the code that we used to make
them.
<FORM>
<TABLE BORDER = "1">
<TR>
<TD>Apples</TD>
<TD><INPUT TYPE = "RADIO" NAME = "fruit"
VALUE = "apples"></TD>
</TR>
<TR>
<TD>Oranges</TD>
<TD><INPUT TYPE = "RADIO" NAME = "fruit"
VALUE = "oranges"></TD>
</TR>
<TR>
<TD>Pears</TD>
<TD><INPUT TYPE = "RADIO" NAME = "fruit"
VALUE = "pears"></TD>
</TR>
</TABLE>
</FORM>
Notice that you can only check one radio
button at one time.
Notice also that with radio buttons
(unlike check boxes), the NAME value will be the same for all
choices within a radio group. If you use a different name, you
will be able to select more than one choice at a time and then
the radio button is essentially a check box that you do not
want.
Finally notice that the VALUE is used
to specify which choice was selected. Thus, if the user selected
Apples, the URL-encoded string would look like the following:
fruit=apples
|