Copy link to clipboard
Copied
Hello,
I have read several similar posts on various ways to do this, but I am still stuck. I am completely NEW to javascript. This is my first attempt!
I've tried to copy similar JS examples, but replace with my labels, but i must be doing it wrong somewhere.
I need to hide a text box based on a radio selection in two instances.
I am running Adobe DC Pro.
I have 2 radio buttons in a group with a text field box for each choice.
Radio buttons are named "Group3" with unique names "Choice1" & "Choice2".
Text field boxes are named "G3C1" and "G3C2"
Goal: If Choice1 is selected, then text box G3C2 becomes hidden. Or if choice 2 is selected, then G3C1 becomes hidden.
Can someone provide me with the exact JS for this?
Appreciate any help - Thank you
Create a hidden text field and set this code as its custom calculation script:
var v = this.getField("Group3").valueAsString;
this.getField("G3C1").display = (v=="Choice1") ? display.visible : display.hidden;
this.getField("G3C2").display = (v=="Choice2") ? display.visible : display.hidden;
Copy link to clipboard
Copied
Create a hidden text field and set this code as its custom calculation script:
var v = this.getField("Group3").valueAsString;
this.getField("G3C1").display = (v=="Choice1") ? display.visible : display.hidden;
this.getField("G3C2").display = (v=="Choice2") ? display.visible : display.hidden;
Copy link to clipboard
Copied
Awesome! That works!
Thank you