Programatically changing dropdown menu selection items?

applab
dropdown

#1

My student wants to take the input from a series of 5 text input fields and populate a dropdown menu with them. He has assigned the input string values to assignment1, assignment2, etc.

We have tried many approaches, but I don’t even know if this is possible at this point. Ideas? (Code we have tried is below. Console.log is showing that the assignmentX variables are picking up the input values from the text input fields.

setProperty(“dropdown_first”,“value”, assignment1, assignment2, assignment3, assignment4, assignment5);
//setText(“dropdown_first”, assignment1, assignment2, assignment3, assignment4, assignment5);
//dropdown(“dropdown_first”, assignment1, assignment2, assignment3, assignment4, assignment5);
//getProperty(“dropdown_first”,assignment1, assignment2, assignment3, assignment4, assignment5);
getProperty(“dropdown_second”,“options”, assignment1, assignment2, assignment3, assignment4, assignment5);
getProperty(“dropdown_third”,“options”, assignment1, assignment2, assignment3, assignment4, assignment5);
getProperty(“dropdown_fourth”,“options”, assignment1, assignment2, assignment3, assignment4, assignment5);
getProperty(“dropdown_fifth”,“options”, assignment1, assignment2, assignment3, assignment4, assignment5);


#2

@nicholsonl

Your first line was almost there! Here is my test program:
var str = prompt(“Enter a value”);
setProperty(“dropdown1”, “options”, [“select”, str]);

Happy computing!
Andrea