Skip to main content
Participating Frequently
November 24, 2020
Answered

Conditions too hide or show for fields with Adobe pro DC

  • November 24, 2020
  • 2 replies
  • 2418 views

Dear Community,

i've tried to configure a Dropdown Menu for a example Car, Bike, House. If i selecet Car, in the next Textfield should House buy date hide and instead of that should Car brand/ model shows. I use Adobe pro DC and i can't find the conditions settings. Many thanks for your support and answers.

 

Best Regards

Noel   

This topic has been closed for replies.
Correct answer Thom Parker

Here is an article on hiding and showing fields:

https://www.pdfscripting.com/public/Hiding-and-Showing-Form-Fields.cfm

 

The delayed selection response you are seeing is because the dropdown value is not being committed immediately. So the validation script isn't run until you exit the field. Fortunately there is a setting for this. Look on the option tab in the dropdown properties dialog. Select the "Commit selection immediately" option. 

 

 

2 replies

Thom Parker
Community Expert
Thom ParkerCommunity ExpertCorrect answer
Community Expert
November 24, 2020

Here is an article on hiding and showing fields:

https://www.pdfscripting.com/public/Hiding-and-Showing-Form-Fields.cfm

 

The delayed selection response you are seeing is because the dropdown value is not being committed immediately. So the validation script isn't run until you exit the field. Fortunately there is a setting for this. Look on the option tab in the dropdown properties dialog. Select the "Commit selection immediately" option. 

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Baba5FB0Author
Participating Frequently
November 24, 2020

Dear Thom Parker,

many thanks for your great answer! Now after selecting a value from the Dropdownmenu the textfields changed immediately!

Many thanks too all

Best Regards

Noel 

try67
Community Expert
Community Expert
November 24, 2020

As the custom validation script of your drop-down field use something like this:

 

this.getField("House buy date").display = (event.value=="House") ? display.visible : display.hidden;

 

You can duplicate that line and adjust the field name and values as needed.

Note that this code does not reset the fields when hiding them, though, so if you want to make sure that that field is also empty when not shown then you'll need to use additional code to do it.

Baba5FB0Author
Participating Frequently
November 24, 2020

Dear Try67,

many thanks for your answer! i will try it and give you a feeback of the results.

 

Best Regards

Noel