Highlighted

Reveal/Hide field based on other fields

Explorer ,
Nov 01, 2020

Copy link to clipboard

Copied

Hi,

 

I know that it is possible to reveal or hide a field based on a value in another, but is it possible to have a field become visible (lets call it "Reveal_A") if the values in two other fields (fields "A" and "B") are specifically entered, e.g. field "A" say has a value of 75.5, and "B" is "16.0".

 

I know its possible to perhaps use script that uses a third field that sums these two values ("A"+"B"), and then used as a single value to then make visible the "Reveal_A" field if the value meets the value defined - just trying to see if this can be done as a script in the field itself "Reveal_A" by referring to the two other values as separate entities. Guessing that my idea might be easier if summing the two fields as previously mentioned?.

 

Thanks

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

Yes, it's definitely possible. You can use something like this as the custom calculation script of "Reveal_A":

 

event.target.display = (this.getField("A").valueAsString=="75.5" && this.getField("B").valueAsString=="16.0") ? display.visible : display.hidden;

TOPICS
PDF forms

Views

32

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Reveal/Hide field based on other fields

Explorer ,
Nov 01, 2020

Copy link to clipboard

Copied

Hi,

 

I know that it is possible to reveal or hide a field based on a value in another, but is it possible to have a field become visible (lets call it "Reveal_A") if the values in two other fields (fields "A" and "B") are specifically entered, e.g. field "A" say has a value of 75.5, and "B" is "16.0".

 

I know its possible to perhaps use script that uses a third field that sums these two values ("A"+"B"), and then used as a single value to then make visible the "Reveal_A" field if the value meets the value defined - just trying to see if this can be done as a script in the field itself "Reveal_A" by referring to the two other values as separate entities. Guessing that my idea might be easier if summing the two fields as previously mentioned?.

 

Thanks

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

Yes, it's definitely possible. You can use something like this as the custom calculation script of "Reveal_A":

 

event.target.display = (this.getField("A").valueAsString=="75.5" && this.getField("B").valueAsString=="16.0") ? display.visible : display.hidden;

TOPICS
PDF forms

Views

33

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Nov 01, 2020 0
Most Valuable Participant ,
Nov 01, 2020

Copy link to clipboard

Copied

Yes, it's definitely possible. You can use something like this as the custom calculation script of "Reveal_A":

 

event.target.display = (this.getField("A").valueAsString=="75.5" && this.getField("B").valueAsString=="16.0") ? display.visible : display.hidden;

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 01, 2020 1
Explorer ,
Nov 02, 2020

Copy link to clipboard

Copied

As always, many thanks for the reply Try67, always on point 😉

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 02, 2020 0