Show pageOld revisionsBacklinksAdd to bookBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Radio Button ====== {{ :scripting:dialogs:radiobutton.png|Radio Button Demo}} Standalone radio button control to show exclusive choices. ===== Properties ===== ^ Property ^ Default Value ^ Description ^ | **id** | empty | id (name) of the script data object (boolean) associated with control | | **title** | empty | title of the control. | | **align** | stretched | [[scripting:dialogs:align|Alignment]] of the control | | **groupstart** | false | Indicator of group start. Group ends by next radio button with //groupstart// set or by last standalone radio button control. Only one radio button in group can be selected. | | **checked** | false | Checked state of the control. Will be taken if no state variable is bound (variable in dialog storage with name corresponding to //id// property) | ===== Events ===== ^ Event ^ Description ^ | **[[scripting:dialogs:events:onclick|onclick]]** | event handler (function name) to be called, if radio button box is clicked| ===== Example ===== <file javascript radiobutton.hejs> var varStorage = new Storage(); var dialog_template = '@<dialog title="Test Dialog" resizing="both"> \ <groupbox title="Options" align="left"> \ <radiobutton title="Option 1" groupstart="true" checked="true" id="option1"/> \ <radiobutton title="Option 2" id="option2"/> \ <radiobutton title="Option 3" id="option3"/> \ <columnbreak/> \ <radiobutton title="Option 4" id="option4"/> \ <radiobutton title="Option 5" id="option5"/> \ </groupbox> \ <group> \ <radiobutton title="Option X" groupstart="true" checked="true" id="optionX" onclick="onOption"/> \ <radiobutton title="Option Y" id="optionY" onclick="onOption"/> \ </group> \ <group minwidth="75" minheight="23" uniform="true" align="center"> \ <button title="&OK" default="true" returnval="ok"/> \ <button title="&Cancel" returnval="cancel"/> \ </group> \ </dialog>@'; Output().writeln("Dialog returns: " + dialog(dialog_template, varStorage)); function onOption() { alert("Control Text: " + this.Text + "\r\nControl Name: " + this.Name); }</file>