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

Lag in Text Field populating Dropdown Field

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

271

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
Community Expert ,
Aug 17, 2018 Aug 17, 2018

Copy link to clipboard

Copied

Where did you place this code?

Votes

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
Community Expert ,
Aug 17, 2018 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;

Votes

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

Votes

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
Community Expert ,
Aug 17, 2018 Aug 17, 2018

Copy link to clipboard

Copied

Check the JS console for errors.

Votes

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
Community Expert ,
Aug 17, 2018 Aug 17, 2018

Copy link to clipboard

Copied

LATEST

use this.getField not thisField

Votes

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