Select item in check box and appears typed in text field

Explorer ,
Feb 09, 2018 Feb 09, 2018

Copy link to clipboard

Copied

Folks,

I have a selection box with the following items to select: Low, Medium and High. I also have a text box where I want the following to appear.

When selecting the item "Low" in the check box, the text box should read "Level 1: Contract manager performs Local Investigation"

When selecting the "Medium" item in the check box, the text box should read "Level 2: Operational manager conducts research in the contract"

When selecting the item "High" in the check box, the text box should read "Level 3: Contract Director / Independent Investigation"

Is there a possibility?

TOPICS
Acrobat SDK and JavaScript

Views

126

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
community guidelines
Most Valuable Participant ,
Feb 09, 2018 Feb 09, 2018

Copy link to clipboard

Copied

Sure, it's possible, but do you want the field to only have one of these values, or should it be possible to edit it freely (for example, if no check-box is ticked)?

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
community guidelines
Explorer ,
Feb 09, 2018 Feb 09, 2018

Copy link to clipboard

Copied

I want you to have one of the values when selecting the item and that someone can not edit. It should be fixed.

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
community guidelines
Most Valuable Participant ,
Feb 09, 2018 Feb 09, 2018

Copy link to clipboard

Copied

LATEST

OK. Let's say the drop-down field is called "Dropdown1". Use this code as the custom calculation script of the text field:

var v1 = this.getField("Dropdown1").valueAsString;

if (v1=="Low") event.value = "Level 1: Contract manager performs Local Investigation";

else if (v1=="Medium") event.value = "Level 2: Operational manager conducts research in the contract";

else if (v1=="High") event.value = "Level 3: Contract Director / Independent Investigation";

else event.value = "";

Set the text field as read-only, so its value can't be changed by the user.

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
community guidelines