Skip to main content
Participant
August 17, 2018
Question

Lag in Text Field populating Dropdown Field

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;

}

This topic is closed to new replies. Start a new post to keep the conversation going.

5 replies

Bernd Alheit
Community Expert
Community Expert
August 17, 2018

use this.getField not thisField

Translate
try67
Community Expert
Community Expert
August 17, 2018

Where did you place this code?

Translate
try67
Community Expert
Community Expert
August 17, 2018

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

var A = event.value;

Translate
Participant
August 17, 2018

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.

Translate