Radio Button

Radio Button Demo Standalone radio button control to show exclusive choices.

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 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)
Event Description
onclick event handler (function name) to be called, if radio button box is clicked
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="&amp;OK" default="true" returnval="ok"/> \
   		<button title="&amp;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);
}