Copy link to clipboard
Copied
I have a group of 2 radio buttons in two lines, related to the first the values a, b, (a*b)
the second line a1, b1, (a1*b1). in a pdf form
I would like to have a script that gives the following:
if RB1 is checked the values a, b, a*b will appear, if RB2 is checked RB1 line will show no values and values in RB2 will appear and vice versa...
RB1 a b a*b
RB2 a b1 a1*b1
Thanks
I'm assuming that the pair of RadioButtons aremutually exclusive( both fields assigned the same fieldname but a different export value).
In the example below, I named the radio buttons fields as "RB", then assign export values of "RB1" and "RB2" respectively.
The caluclating fileds are named with the same labels that you used in your inquiry to make it easier to visualize.
You can use the following script as a custom calculation script in the the (a*b) total field, for example:
event.value = t
...
Copy link to clipboard
Copied
Are you asking about hiding the fields ?
Copy link to clipboard
Copied
Yes, please.
Copy link to clipboard
Copied
I'm assuming that the pair of RadioButtons aremutually exclusive( both fields assigned the same fieldname but a different export value).
In the example below, I named the radio buttons fields as "RB", then assign export values of "RB1" and "RB2" respectively.
The caluclating fileds are named with the same labels that you used in your inquiry to make it easier to visualize.
You can use the following script as a custom calculation script in the the (a*b) total field, for example:
event.value = this.getField("a").value * this.getField("b").value;
var f = this.getField("RB");
if (f.value == "RB1") {
this.getField("a").display = display.visible;
this.getField("b").display = display.visible;
event.target.display = display.visible;
} else {
this.getField("a").display = display.hidden;
this.getField("b").display = display.hidden;
event.target.display = display.hidden;
}
if (f.value == "RB2") {
this.getField("a1").display = display.visible;
this.getField("b1").display = display.visible;
this.getField("ab1").display = display.visible;
} else {
this.getField("a1").display = display.hidden;
this.getField("b1").display = display.hidden;
this.getField("ab1").display = display.hidden;
}
Copy link to clipboard
Copied
Thanks a lot, it works perfectly!
I do appreciate your help.