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

How to insert different text contents depending on input to a specific field in a fillable form

New Here ,
Mar 06, 2019 Mar 06, 2019

I'm using Acrobat Pro DC 2019 (Win10). I would like to create a fillable form whereby one section of the form will have different text contents (3-4 bullets) depending on the input to a specific field. For example:

If input is "one", the section is to be populated with the following:

     - Beautiful world

     - What a wonderful day

     - I love what I do

If input is "two", the section is to be populated with the following:

     - You're not bad

     - She's OK

If input is "three", populate with the following:

     - Let me give it a try

     - I love music

     - Please paint a picture for me

     - How must is a movie ticket these days

If this is do-able with Acrobat Pro DC, any tips/instructions would be much appreciated.

TOPICS
PDF forms
1.6K
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 ,
Mar 07, 2019 Mar 07, 2019

Content on a PDF is fixed, you'd need to place the maximum number of bullet lines needed. But yes, you could set field values with each selection that change the items in the bullet list. Scripting is required for this. Do you have any experience with JavaScript?

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
New Here ,
Mar 07, 2019 Mar 07, 2019

Unfortunately, I don't have any knowledge of JavaScript at all.

So I assume the approach is to place all the possible bullets in that section and hide those don't apply, and the JavaScript would determine which bullets to show + align the bullets together?

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 ,
Mar 07, 2019 Mar 07, 2019

That would be one way to do it.  In fact, you could create a solution that hides and shows existing entries using radio buttons and no scripting. One of the actions on a MouseUp event is show/hide fields.  But you couldn't align any items.

But my solution would be to change the text in the form fields based on the selection. This is much easier than having lots of hidden items to manage.

Another solution is to use a List Field instead of regular bullet list.

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
New Here ,
Mar 07, 2019 Mar 07, 2019

Aligning the items is important for me with this form, as otherwise it would be very ugly, so the MouseUp option would be last resort.

I had shorten my examples but the true text i will need in my document is actually all long bullets, so I believe the List Field might not be able to handle it properly, but I will give it a try. It sounds like your solution would be best but I guess I will have to start learning JavaScript 

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 ,
Mar 07, 2019 Mar 07, 2019
LATEST

See this article on changing a field from a dropdown:

https://acrobatusers.com/tutorials/change_another_field

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