Set the style of dynamically generated radio buttons
Posted: 10 Sep 2019, 01:42
With the assistance of Support I have setup an global Auto-GUI rule to dynamically create radio buttons based on the text displayed on the screen after the input field. For example after an input field I have the following text
1=Option 1, 2=Option 2, 3=Option 3
The script below converts them to a set of radio buttons with the text Option 1, Option 2 and Option 3.
var fld = FIELD.nextField();
var oOptions = fld.getValue();
var aOptions = oOptions.split(",");
var ret = [];
var idx = 0;
aOptions.forEach(function(entry) {
var val = entry.split("=");
ret[idx]= {value: val[0].trim(), text: val[1]};
idx++;
}
);
ENV.returnValue = ret;
I now want to set the colour of the text to blue. I tried using the style option in the Auto GUI but this has no effect. I tried changing the JavaScript to use the font color intrinsic.
ret[idx]= {value: val[0].trim(), text: val[1].fontcolor("blue")};
Rather than the font color changing I get the HTML tags displayed.
<font color="blue">PDD</Font>
Has anyone had any experience changing the style of dynamically created controls?
Thanks in advance.
Best Regards,
Eugene
1=Option 1, 2=Option 2, 3=Option 3
The script below converts them to a set of radio buttons with the text Option 1, Option 2 and Option 3.
var fld = FIELD.nextField();
var oOptions = fld.getValue();
var aOptions = oOptions.split(",");
var ret = [];
var idx = 0;
aOptions.forEach(function(entry) {
var val = entry.split("=");
ret[idx]= {value: val[0].trim(), text: val[1]};
idx++;
}
);
ENV.returnValue = ret;
I now want to set the colour of the text to blue. I tried using the style option in the Auto GUI but this has no effect. I tried changing the JavaScript to use the font color intrinsic.
ret[idx]= {value: val[0].trim(), text: val[1].fontcolor("blue")};
Rather than the font color changing I get the HTML tags displayed.
<font color="blue">PDD</Font>
Has anyone had any experience changing the style of dynamically created controls?
Thanks in advance.
Best Regards,
Eugene