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

Autofill based on tick box selections

New Here ,
Jan 23, 2018 Jan 23, 2018

I'm very new to creating forms and have never used any Java Scripts, but I'm hoping that someone here can help me.

I have a kit that has a lot of configuration options. every time we send one of these to a customer we have to type out all the items included into a kitting list.

what I want to know is if/how I could have a page full of tick box selections that someone can go though and easily mark what is in the kit, that will then populate a list or text box?

Many thanks in advance!

TOPICS
Acrobat SDK and JavaScript , Windows
528
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

correct answers 1 Correct answer

Community Expert , Jan 23, 2018 Jan 23, 2018

There are a couple of ways to do this. A multi-line text box with a calculation script is a good way to go.

Here's a very straight forward custom calculation script:

event.value = "";

if(this.getField("Checkbox1").value == "Yes")

  event.value += "Item 1\n";

if(this.getField("Checkbox2").value == "Yes")

  event.value += "Item 2\n";

You'll need to change out the checkbox names and the messages. The "\n" is a line feed, it's necessary to put each item on it's own line.

There are better ways to do this, bu

...
Translate
Community Expert ,
Jan 23, 2018 Jan 23, 2018

There are a couple of ways to do this. A multi-line text box with a calculation script is a good way to go.

Here's a very straight forward custom calculation script:

event.value = "";

if(this.getField("Checkbox1").value == "Yes")

  event.value += "Item 1\n";

if(this.getField("Checkbox2").value == "Yes")

  event.value += "Item 2\n";

You'll need to change out the checkbox names and the messages. The "\n" is a line feed, it's necessary to put each item on it's own line.

There are better ways to do this, but this is among the simplest.

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 ,
Jan 23, 2018 Jan 23, 2018
LATEST

Hi Thom,

I'll try this out, Thanks you!

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