Skip to main content
New Participant
November 28, 2017
Question

Using one Dropdown list to Populate another works, but can't make selections in second Dropdown

  • November 28, 2017
  • 1 reply
  • 608 views

I was using the switch script in a custom calculation script in a dropdown to populate a 2nd dropdown (which works correctly), but I can't actually make a selection in the 2nd dropdown list. The list is made and I can click on it to see the populated options, but clicking off the dropdown list after selecting an option besides the first causes it to revert back to the default choice. I assume it has something to do with the list being re-populated after making my choice, but I have no idea on how to stop it.

This topic has been closed for replies.

1 reply

Bernd Alheit
Community Expert
November 28, 2017

Don't use a calculation script for this.

New Participant
November 28, 2017

What do you suggest I use instead?

try67
Community Expert
November 28, 2017

Here's an example:

switch (event.value) { 

    case "1":

        this.getField("Sub1").setItems([""]);

        break;

    case "2":

        this.getField("Sub1").setItems(["","1","2","3"]); 

        break;

    case "3":

        this.getField("Sub1").setItems([""]); 

        break;

     case "4":

        this.getField("Sub1").setItems([""]); 

        break;

     case "5":

        this.getField("Sub1").setItems(["","1","2","3"]); 

        break;

          }

The Sub1 dropdown will populate a blank space, 1, 2, and 3 when I select 2 on the first dropdown, but like I said, It'll go back to the blank spot when I click off. How do you suggest I change my script so that it works in custom validation or a keystroke script?


Just move it as-is to be a custom validation script.