setRadioGroupValue
setRadioGroupValue
Sets a radio group's selected value programmatically.
Parameters
groupId(string): The identifier of the radio groupgroupValue(string): The value to select within the group
Returns: None (void)
Radio widget setup
To control a radio group from a script, configure the Radio widgets placed on the Form as follows.
| Property | Description |
|---|---|
| groupId | Set every radio button that should act as one group to the same value. It must match the first argument to setRadioGroupValue. |
| value | The unique identifier of each radio button. The radio whose value matches the second argument (groupValue) becomes selected. |
note
The groupValue property is managed automatically at runtime, so you don't need to set it yourself.
Example setup
Assume three Radio widgets placed as follows.
| Widget | groupId property | value property |
|---|---|---|
| Radio 1 | orderType | market |
| Radio 2 | orderType | limit |
| Radio 3 | orderType | stop |
Running the script below in that state selects Radio 2 (value: "limit").
$form.setRadioGroupValue("orderType", "limit");
Example
// 주문 유형 라디오 그룹 값 설정
$form.setRadioGroupValue("orderType", "limit");
$form.setRadioGroupValue("orderType", "market");
Related
$form.getRadioGroupValue(groupId)— reads the current selection