Hi, very new to Formcalc. I have a simple question: I have two check boxes and if I set one I want to un-set the other. I know Radio buttons do this but I need to use check boxes. My code that is being thrown out is:
if (BookingMatrix.Row1.CheckBox[0]==1) then BookingMatrix.Row1.CheckBox[1]=0
I have also tried .value & .rawvalue, neither seem to work. The error I get is "syntax error near token "0"
Can anyone help, please:-)
Views
Replies
Total Likes
Try this.
Using Javascript. Under change, put these for your checkboxs. Rename appropriately.
Checkbox1
if (this.rawValue == "1") {
this.resolveNode("CheckBox1").rawValue = "0";
}
Checkbox2
if (this.rawValue == "1") {
this.resolveNode("CheckBox2").rawValue = "0";
}
Views
Replies
Total Likes
Hi, Many thanks for the swift reply, but as I'm using Formcalc throughout the document, I'm not sure how to include Jscript at the same time.
Views
Replies
Total Likes
You should be able to just set those to java and still use formcalc throughout the rest of the form
Views
Replies
Total Likes
Hi,
Code for 1st CB now reads:
if (BookingMatrix.Row1.CheckBox[0].rawValue == "1") {
BookingMatrix.Row1.CheckBox[1].resolveNode("CheckBox1").rawValue = "0";
}
Code for 2nd CB now reads:
if (BookingMatrix.Row1.CheckBox[1].rawValue == "1") {
BookingMatrix.Row1.CheckBox[0].resolveNode("CheckBox2").rawValue = "0";
}
No errors, but the CB states do not change when clicked. Was a bit unsure about your "CheckBox1" and "CheckBox2" and whether these need to be replaced with something. Sorry to be a pain....
Views
Replies
Total Likes