Trying to change the setvalue of a checkbox in a on focus event of another control in the control group with js.
The checkbox has 4 choices based on a variable. One or more boxes may have already been checked after the dialoginitialize event fires, and the component is rendered. The on focus event needs to add an additional check to a box if it is not already checked, without affecting the boxes already checked.
So colorcontrol with choices red, blue, and orange that has red checked after its rendered will add a check to orange when the on focus event is fired.
I'm thinking that it must also test if Orange is already checked and if it is do nothing. The other thought I have is that you can't just add a check, but must do a test to find out what is already checked, store that, and add orange to it. Then update the control.
Getting confused on the values in the check box variable red, blue, orange, verses their true/checked or false/unchecked attributes.
Most of the posts I reviewed don't explain the array of check box values (the colors), and their individual checked attribute, and how to set each using js.
For instance:
function check() {
document.getElementById("myCheck").checked = true;
} //this function sets the value of a single checkbox control choice, how do you adapt it for a multiple choice checkbox?
Thanks,
Bob
The checkbox has 4 choices based on a variable. One or more boxes may have already been checked after the dialoginitialize event fires, and the component is rendered. The on focus event needs to add an additional check to a box if it is not already checked, without affecting the boxes already checked.
So colorcontrol with choices red, blue, and orange that has red checked after its rendered will add a check to orange when the on focus event is fired.
I'm thinking that it must also test if Orange is already checked and if it is do nothing. The other thought I have is that you can't just add a check, but must do a test to find out what is already checked, store that, and add orange to it. Then update the control.
Getting confused on the values in the check box variable red, blue, orange, verses their true/checked or false/unchecked attributes.
Most of the posts I reviewed don't explain the array of check box values (the colors), and their individual checked attribute, and how to set each using js.
For instance:
function check() {
document.getElementById("myCheck").checked = true;
} //this function sets the value of a single checkbox control choice, how do you adapt it for a multiple choice checkbox?
Thanks,
Bob