Radio object represents a single radio button, created by an HTML
<INPUT> tag of type "radio", in a series from which the user may
select only one. It is for this reason that all radio buttons in a group
must have the same value for the NAME attribute. The Radio object
is a form element and as such must be included within a <FORM> tag.
radio button on the form. Those which form a group, and hence share the
same NAME attribute, are stored as an array of that name. This array is
in turn stored as a single element of the elements array of the
Form object. You can access a set of radio buttons through this
elements array either by the index number or by name. To access
an individual button you need to refer to it as an element of the array
of those buttons with the same NAME attribute.
For instance, assuming a set of radio buttons with the name "drink",
you could refer to it as follows:
...or by its number in the elements array of the appropriate
form (assume it to be 3 in this case):
Then, say, to display the value of the radio button at element # 1
of the "drink" array, you could use the following code:
This property, which is by default tainted, is a Boolean value which
reflects whether a particular radio button has been selected, returning
true if it has and false if not. As only one radio button
in a set can be selected at any one time, it follows that if the select
property of one is true, then that property for the others of
that set is false. The checked property can be set at
any time and the change is immediately reflected in the display.
This property, which is by default tainted, is a Boolean value initially
reflecting whether a particular radio button was selected by default
using the CHECKED attribute, returning true if it was, and false
if not. The defaultChecked property can be set at any time, but
the change is not displayed, nor does it affect the defaultChecked
property of any other radio button in the set.
This property is a reference to the parent form of a set of radio buttons
that share the same NAME attribute.
This property, tainted by default, refers to the NAME attribute of the
set to which one particular radio button belongs. The name property
can be set at any time but doing so places a radio button in a different
This property specifies the type of an element in a form and reflects
the TYPE attribute. In the case of a set of radio buttons, this is "radio".
It is this property that is returned to the server when a radio button
is selected and the form submitted. It is not displayed and so is not
necessarily the same as any text that may appear alongside the radio
button. The value property is tainted by default and reflects
the VALUE attribute of the HTML code. Where no value is specified, the
value property is the string "on".
This method removes focus from a selection list.
This method programatically triggers a radio buttons onClick
This method moves the focus to the specified selection list allowing
the user to then select from it.
This method calls the handler for a specified event.
The Radio object also inherits the watch
and unwatch methods from the
blur event occurs; i.e. whenever a window, frame or form element loses
user clicks (i.e. when the mouse button is pressed and released) on
a Form object.
i.e. whenever the user focuses on a window, frame or frameset, or inputs
to a form element.