Skip to main content

setRadioGroupValue

setRadioGroupValue

Sets a radio group's selected value programmatically.

Parameters

  • groupId (string): The identifier of the radio group
  • groupValue (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.

PropertyDescription
groupIdSet every radio button that should act as one group to the same value. It must match the first argument to setRadioGroupValue.
valueThe 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.

WidgetgroupId propertyvalue property
Radio 1orderTypemarket
Radio 2orderTypelimit
Radio 3orderTypestop

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