Forum Discussion
AustinK
6 years agoQrew Commander
This might not be the best way but I like it. I build the html line by line with a loop. You know the ID of your select box already so you just have to clear the innerHTML and then build each option out. You need to get to a point where you have all the information you want to include in the dropdown and then just make it with a loop. "Selection" would be your select/dropdown menu and you would find that by ID and assign it to the variable selection.
I run the next part in a loop that goes over my array of info and builds a select option for each one with this line plus a few others that pull the info from my returned JSON.
selection.innerHTML += "<option value=\"" + recordID + "\">" + name + ": " + description + "</option>";
Hopefully I'm understanding what you are wanting to do here.
I run the next part in a loop that goes over my array of info and builds a select option for each one with this line plus a few others that pull the info from my returned JSON.
selection.innerHTML += "<option value=\"" + recordID + "\">" + name + ": " + description + "</option>";
Hopefully I'm understanding what you are wanting to do here.
EOMDevelepors
6 years agoQrew Captain
Thanks for your reply. I am trying to show the options based on my array created in my code called xmlOptions. I just need to view the options from that array and show field 9 and the value should be field 8 which can be passed on later when pressing ok to update the record with that option.
Thanks again
Thanks again