Previous ION Script User's Guide: ION Script Tag Reference Next

ION_RADIO

An ION_RADIO button is similar to an HTML radio button created with <INPUT TYPE="RADIO">. ION_RADIO allows you to maintain the selection state of a radio button group when reloading the page.

Syntax

<ION_RADIO
NAME="group name"
VALUE="value"
[DEFAULT]
[<INPUT TYPE="RADIO"> attributes] />

Attributes

DEFAULT

Include this attribute to cause this radio button to be the button that is initially selected when the page loads for the first time. Only one button in a group can include this attribute.

NAME

The name of the radio button group. Each radio button in a group uses the same NAME. This name is used to refer to the value of the selected radio button using the format $Form.NAME. This attribute can contain a variable. The NAME you specify for form fields cannot begin with ION_ _.

VALUE

The value assigned to the radio button, which can be accessed using $Form.NAME. If this value is numeric, and you want to use it in an expression, you must declare a new INT or DOUBLE variable, assign it the value $Form.NAME, and use the new variable in the expression instead of $Form.NAME. See Using $Form Variables in Numeric Expressions. This attribute can contain a variable.


Note
All attributes of the HTML <INPUT TYPE="RADIO"> are also available to ION_RADIO. See INPUT.

HTML Mapping

The ION_RADIO tag is converted to the HTML <INPUT TYPE="radio"> tag. The NAME and VALUE attributes of the ION_RADIO tag become the NAME and VALUE attributes of the <INPUT> tag. If DEFAULT is specified, it becomes the CHECKED attribute of the <INPUT TYPE="radio"> tag. All attributes of the HTML <INPUT> tag are also available to ION_RADIO.

Example

In this example, we create a group of radio buttons, and a button with an EVENT that reloads the page. When the user clicks the button, the name of the selected button is written to the page. Note the following in this example:

The following figure shows the result of this example:

 

Figure 5-10: Results of ION_RADIO Example

Figure 5-10: Results of ION_RADIO Example

  IDL Online Help (March 06, 2007)