Copy link to clipboard
Copied
I found out how to hide a text field (or fields) based on if data is entered into another text field. Meaning, a text field is hidden if nothing is entered into another one elsewhere in the form. Is it possible to hide/unhide bullet points adjacent to the text field depending on whether it's hidden/unhidden. Screenshot of form attached. Any help would be greatly appreciated. Thanks!
I currently hide/unhide text fields with the below script, but cannot figure out how to hide/unhide the corresponding bullets.
this.getField("Target field name").display = (event.value=="") ? display.hidden : display.visible;
Copy link to clipboard
Copied
Picture attached. I would like to type into UA1 and have a bullet appear at B2 and UA2 text field to become active
Copy link to clipboard
Copied
You can use this script in one of the fields as 'Custom calculation script' it will work for all fields:
for(var i=1; i<=4; i++){
if(this.getField("UA"+i).valueAsString != ""){
this.getField("UA"+(i+1)).display = display.visible;
this.getField("B"+(i+1)).display = display.visible;}
else{
this.getField("B"+(i+1)).display = display.hidden;
this.getField("UA"+(i+1)).value = "";
this.getField("UA"+(i+1)).display = display.hidden;}}
Copy link to clipboard
Copied
Use read-only text fields for the bullets and show/hide this fields.
Copy link to clipboard
Copied
Thanks for your reply. Could you elaborate about the scripting or setup. Also, the above script for the text fields only worked for "Field A" to "Field B", but not the others (C, D, and E). I found the below script and input it into "Field A" and now works for successive fields.
this.getField("Field B").display = (event.value=="") ? display.hidden : display.visible;
Copy link to clipboard
Copied
Correction: Input script in Field A-D, just changing "Target Field Name" accordingly.
I just need to know how to apply similar logic to the corresponding bullet points. Thanks!
Copy link to clipboard
Copied
The same way.
Copy link to clipboard
Copied
I am not able to successfully apply the above script to the 5 rows of "bullet text fields". I am able to use the above script to make the "text entry fields" successively appear/become active, but the "bullet" text fields are a fixed entry, dependent on the adjacent "text entry field". I basically need an if/then statement: If text is in Field 1 then have a bullet appear adjacent to that row. Tried toggling to "read-only" for bullets. Really appreciate the help, this is quite new to me.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Set the default value of "B2" to be the bullet character, and set it as read-only.
Then use this code as the Calculation script for "UA1":
if (event.value=="") {
this.getField("B2").display = display.hidden;
this.getField("UA2").display = display.hidden;
this.getField("UA2").value = "";
} else {
this.getField("B2").display = display.visible;
this.getField("UA2").display = display.visible;
}
Copy link to clipboard
Copied
You can use this script in one of the fields as 'Custom calculation script' it will work for all fields:
for(var i=1; i<=4; i++){
if(this.getField("UA"+i).valueAsString != ""){
this.getField("UA"+(i+1)).display = display.visible;
this.getField("B"+(i+1)).display = display.visible;}
else{
this.getField("B"+(i+1)).display = display.hidden;
this.getField("UA"+(i+1)).value = "";
this.getField("UA"+(i+1)).display = display.hidden;}}
Copy link to clipboard
Copied
Thank you both for your help!!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now