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

If then in PDF form

New Here ,
Oct 25, 2023 Oct 25, 2023

I am trying to make an if then statement where if one item is selected in a drop down box it auto populates a text box with pre defined text, but if the other option is selected it's a blank textbox.

 

What's the best way to do this?

TOPICS
Create PDFs , Edit and convert PDFs , JavaScript , PDF , PDF forms
323
Translate
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 ,
Oct 25, 2023 Oct 25, 2023

Make the predefined text the export value of each item in the dropdown. Then use a Custom keystroke script to fill the text box. Like this:

 

if(!event.willCommit) this.getField("TextField").value = event.changeEx;

 

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Translate
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 ,
Oct 26, 2023 Oct 26, 2023
LATEST

Should the text in the text field be the same as the selected item in the drop-down, or something else?

Should the user be able to enter something into the text field, if one of the other options is selected in the drop-down?

Translate
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