Autofill based on tick box selections

New Here ,
Jan 23, 2018

Copy link to clipboard

Copied

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!

Adobe Community Professional
Correct answer by Thom Parker | Adobe Community Professional

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.

TOPICS
Acrobat SDK and JavaScript, Windows

Views

128

Likes

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

Autofill based on tick box selections

New Here ,
Jan 23, 2018

Copy link to clipboard

Copied

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!

Adobe Community Professional
Correct answer by Thom Parker | Adobe Community Professional

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.

TOPICS
Acrobat SDK and JavaScript, Windows

Views

129

Likes

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
Jan 23, 2018 0
Adobe Community Professional ,
Jan 23, 2018

Copy link to clipboard

Copied

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.

Likes

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
Reply
Loading...
Jan 23, 2018 0
New Here ,
Jan 23, 2018

Copy link to clipboard

Copied

Hi Thom,

I'll try this out, Thanks you!

Likes

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
Reply
Loading...
Jan 23, 2018 0