Copy link to clipboard
Copied
Is it possible to freeze /unfreeze (show/hide) a text box in a dialog box based on status of another check box located in the the same dialog box?
You should be able to use the visible control for turning off and on items in the dialog box coupled with a onClick function for the check box.
var dlg = new Window ('dialog','Visibility Text');
dlg.gp = dlg.add('group');
var sTxt = dlg.gp.add('statictext',undefined,'Hide This')
var cBx = dlg.gp.add('checkbox',undefined,'Click to Hide')
cBx.value = false
cBx.onClick = function(){
if (cBx.value){sTxt.visible = false}
else{sTxt.visible = true}
}
dlg.show()
Copy link to clipboard
Copied
For now it look like on picture below, but i need to enable if i select No, other fields need to be hiden/frozen.
Copy link to clipboard
Copied
You should be able to use the visible control for turning off and on items in the dialog box coupled with a onClick function for the check box.
var dlg = new Window ('dialog','Visibility Text');
dlg.gp = dlg.add('group');
var sTxt = dlg.gp.add('statictext',undefined,'Hide This')
var cBx = dlg.gp.add('checkbox',undefined,'Click to Hide')
cBx.value = false
cBx.onClick = function(){
if (cBx.value){sTxt.visible = false}
else{sTxt.visible = true}
}
dlg.show()