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

If then in PDF form

New Here ,
Oct 25, 2023 Oct 25, 2023

Copy link to clipboard

Copied

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

Views

225

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 ,
Oct 25, 2023 Oct 25, 2023

Copy link to clipboard

Copied

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

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

Copy link to clipboard

Copied

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?

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