Trying to Disable/Enable Edittext field in UI but not Working!
Hi Experts..
I'm trying hard to make edittext user input field to be disabled and enabled , it shouid be disable at first time until user interact with the UI and select the third radio button and it shouid be enabled! and i the user select another radio button it shouid be disabled but not working at all , here is my code (Part of Script UI) :
//Adding Page Number Group
var myPageNum = RadioPanel.add("group", undefined, {name: "myPageNum"});
myPageNum.preferredSize.width = 102;
myPageNum.orientation = "row";
myPageNum.alignChildren = ["right","right"];
myPageNum.spacing = 0;
myPageNum.margins =5; //Just Before Buttons
//myRadioGroup.orientation = "row";
myPageNum.add ("statictext", undefined, "Page Number:");
var myNum = myPageNum.add ("edittext", undefined, "5");
myNum.characters = 4;
//My edittext for PageNumbering is Disabled at first
myNum.enabled = false;
//Check if the typed is Number or not
myNum.onChange = checktext;
function checktext() {
if (isNaN(Number(this.text))) {
alert("Are you Kidding! , Only numbers Accepted!");
myNum.text = ""
}
}
//Check For Enable or Disable Edittext field
radio3.onChange = checkradio3;
function checkradio3() {
if (radio3.value == true)
if (myNum.enabled == false)
myNum.enabled = true;
else if (radio3.value == false) {
myNum.enabled = false;
}
}also i tried direclty with if condition code :
if (radio3.value == true) {
myNum.enabled = true;
}
else if (radio3.value == false) {
myNum.enabled = false;
}but no success!, every time i launch the script it will show (disabled edittext field) and if i try to select the third radio button (radio 3) nothing happened at all, please help and thanks in advance
Best
M.Hasanain
