Copy link to clipboard
Copied
Hi All
What I am trying to achieve is, if you refer to the attached PDF - look at the only 2 populated fields and what I I want is if some enters any text for the Install Height then it shhould not allow them to choose from the dropdown menu in Loop Size. So any text entered in Install Height disables Loop Size. I have tried but as soon as I click Install Height then Loop Size disappears but it does not return if I do not enter any Install Height information.
There would be a further 10 rows of these so I presume I would have to rename then Loop Size1, Loop Size 2 for each row.
Thanks in advance.
Copy link to clipboard
Copied
Remove the scripts you have and as custom calculation script of one of the fields, use this:
for(var i=1; i<=11; i++){
if(this.getField("Install Height "+i).valueAsString == "")
this.getField("Loop Size "+i).display = display.visible;
else
this.getField("Loop Size "+i).display = display.hidden;}
11 represents 11 rows you have, so when you add all 11 rows, the script will work.
Here is your file with added 3 fields to test:
https://drive.google.com/file/d/1YOd8w6BXzhZOmO8bOj53DfBvKR22695I/view?usp=share_link
Copy link to clipboard
Copied
Remove the scripts you have and as custom calculation script of one of the fields, use this:
for(var i=1; i<=11; i++){
if(this.getField("Install Height "+i).valueAsString == "")
this.getField("Loop Size "+i).display = display.visible;
else
this.getField("Loop Size "+i).display = display.hidden;}
11 represents 11 rows you have, so when you add all 11 rows, the script will work.
Here is your file with added 3 fields to test:
https://drive.google.com/file/d/1YOd8w6BXzhZOmO8bOj53DfBvKR22695I/view?usp=share_link
Copy link to clipboard
Copied
Wow - thanks so much for the response - very much appreciated. So when the rest of the form is populated do I have to rename each row 1 to 11 (or it normally autofills other rows). Thanks again.
Copy link to clipboard
Copied
That script will work on all rows as long as you name your fields correctly, "Install Height 1-11" and same for "Loop Size".
Copy link to clipboard
Copied
Ah got it - thanks for all your help.

