I have a dropdown menu created from PHP querying the database and then using a foreach to create a list of options for this dropdown menu.
However, in my form, users might need to enter more of the same fields, so I was wondering if it is possible to copy the JavaScript code as a drop-down list with all its values, and then put it in the same form?
Why do I think so, because I cannot find a way to pass the PHP array to JavaScript, or at least I cannot find a way to do this :(
source share