• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit Search
0

Make a Dropdown Menu Field unfillable if text entered in specific field

New Here ,
Mar 08, 2023 Mar 08, 2023

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.

TOPICS
PDF forms

Views

597

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
community guidelines

correct answers 1 Correct answer

Community Expert , Mar 08, 2023 Mar 08, 2023

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

...

Votes

Translate

Translate
Community Expert ,
Mar 08, 2023 Mar 08, 2023

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 

Votes

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
community guidelines
New Here ,
Mar 08, 2023 Mar 08, 2023

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.

Votes

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
community guidelines
Community Expert ,
Mar 08, 2023 Mar 08, 2023

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".

Votes

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
community guidelines
New Here ,
Mar 08, 2023 Mar 08, 2023

Copy link to clipboard

Copied

LATEST

Ah got it - thanks for all your help.

Votes

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
community guidelines