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;
}
Copy link to clipboard
Copied
Where did you place this code?
Copy link to clipboard
Copied
If it's the validation script of "Model #", change the first line to:
var A = event.value;
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.
Copy link to clipboard
Copied
Check the JS console for errors.
Copy link to clipboard
Copied
use this.getField not thisField