Radio Buttons Screen

This example shows how you can detect which radio button was selected from a default Radio Buttons screen.

To try this example, paste the following code onto the On Next event (before the Screen.Next action) of a Radio Buttons screen. This event can be found on the Actions tab of the screen's properties.

-- Convert the selected radio button control to a number for the comparison.
nSelectedControl = String.ToNumber(SessionVar.Expand("%RadioSelection%"));

-- Check to see which radio button was selected by comparing the selected radio button and each raido button control ID.
if (nSelectedControl == CTRL_RADIO_BUTTON_01) then
    Dialog.Message("Radio Buttons", "The first radio button was selected.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
elseif (nSelectedControl == CTRL_RADIO_BUTTON_02) then
    Dialog.Message("Radio Buttons", "The second radio button was selected.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
elseif (nSelectedControl == CTRL_RADIO_BUTTON_03) then
    Dialog.Message("Radio Buttons", "The third radio button was selected.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
elseif (nSelectedControl == CTRL_RADIO_BUTTON_04) then
    Dialog.Message("Radio Buttons", "The fourth radio button was selected.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
end

This action script demonstrates how to determine which radio button was selected on a Radio Buttons screen. In this example, a dialog message is shown when you click the Next button.