I’m fairly new to programming and trying to resolve what seems like a basic problem.
I am using Moodle and need to make an amendment in one of the modules using a little bit of Javascript.
I have an array called [[Loacation]] I want to create a dropdown in an HTML from which will populate from this array. I could probably just about do it in php using the foreach command, but I need to be able to do it clientside using Javascript.
Moodle is an LMS with several modules built into it. One is a database module which can display records uploaded to it from a csv file.
Each field becomes an array of values depending on which record you are displaying.
One of these fields I have called Location which produces the array [[Location]]
What I want to do, is in the search function, create a dropdown list of all the values in this array so the user can select which location they are interested in and then display all records which hold this information, otherwise I am reliant on the user spelling the locations correctly.