Lag in Text Field populating Dropdown Field

New Here ,
Aug 17, 2018

Copy link to clipboard

Copied

I am using a validation code to in a text field, which I is to be typed into, to define a dropdown based on said typed in value. When I first started, the pdf would lag and show the options in the dropdown for the case I had just deleted from the typed field. For example, if you look at the code below, if I typed in "VS06", it would show nothing. And then, if I typed in "VS08", it would show the options for "VS06". But, I tried to make some changes, found out they didn't solve my issue, reverted back, and now, nothing is updating at all.  Please help.

var A = this.getField("Model #").value; //gets model number

var B = A.substr(0,4);               //isolating size        

switch (B){            //selecting size

    default:

        thisField("DHT CV Line").setItems(["nothing", "more nothing"]);

        break;

    case "VS06":

        thisField("DHT CV Line").setItems(["6","st"]);

        break;

    case "VS08":

        thisField("DHT CV Line").setItems(["8","st"]);

        break;

    case "VS10":

        thisField("DHT CV Line").setItems(["10", "st"]);

        break;

    case "VS12":

        thisField("DHT CV Line").setItems(["12", "st"]);

        break;

}

TOPICS
Acrobat SDK and JavaScript, Windows

Views

71

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

Lag in Text Field populating Dropdown Field

New Here ,
Aug 17, 2018

Copy link to clipboard

Copied

I am using a validation code to in a text field, which I is to be typed into, to define a dropdown based on said typed in value. When I first started, the pdf would lag and show the options in the dropdown for the case I had just deleted from the typed field. For example, if you look at the code below, if I typed in "VS06", it would show nothing. And then, if I typed in "VS08", it would show the options for "VS06". But, I tried to make some changes, found out they didn't solve my issue, reverted back, and now, nothing is updating at all.  Please help.

var A = this.getField("Model #").value; //gets model number

var B = A.substr(0,4);               //isolating size        

switch (B){            //selecting size

    default:

        thisField("DHT CV Line").setItems(["nothing", "more nothing"]);

        break;

    case "VS06":

        thisField("DHT CV Line").setItems(["6","st"]);

        break;

    case "VS08":

        thisField("DHT CV Line").setItems(["8","st"]);

        break;

    case "VS10":

        thisField("DHT CV Line").setItems(["10", "st"]);

        break;

    case "VS12":

        thisField("DHT CV Line").setItems(["12", "st"]);

        break;

}

TOPICS
Acrobat SDK and JavaScript, Windows

Views

72

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
Aug 17, 2018 0
Most Valuable Participant ,
Aug 17, 2018

Copy link to clipboard

Copied

Where did you place this code?

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...
Aug 17, 2018 0
Most Valuable Participant ,
Aug 17, 2018

Copy link to clipboard

Copied

If it's the validation script of "Model #", change the first line to:

var A = event.value;

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...
Aug 17, 2018 0
New Here ,
Aug 17, 2018

Copy link to clipboard

Copied

It is in fact a validation script of "Model #", and that is a helpful tip. However, now it won't populate "DHT CV Line" with anything.

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...
Aug 17, 2018 0
Most Valuable Participant ,
Aug 17, 2018

Copy link to clipboard

Copied

Check the JS console for errors.

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...
Aug 17, 2018 0
Adobe Community Professional ,
Aug 17, 2018

Copy link to clipboard

Copied

use this.getField not thisField

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...
Aug 17, 2018 0