0
I have four comboboxes populated with data from a database, using js. The user selects options in these 4 boxes and, from there, I want to do a query with the options chosen. How can I take these options and save them in variables to use in my query?
When you say "combobox" you mean a
select
with severaloption
s, right? Give aname
at theselect
and avalue
for eachoption
causes thevalue
thatselect
is the value of the selected item. Then you can submit as part of a form or - if you are using ajax - get it in the same way as you would get the value of any element (eg.:var valor = document.getElementById("meuSelect").value
).– mgibsonbr
For example, the first combobox is a list of cities. Options are filled by a while with mysql_fetch_assoc.
– Geralt