I am currently trying to pass a select list (the whole list) into a php page and grabbing the individual values from the list to do a dynamic sql query. I pass in selectItems, but when I perform an echo, I get
[object HTMLSelectElement]
I have also tried passing in selectItems.value, but that only passes in one of the 3 list items.I have searched for the past day and I haven't had much success. I'm not too sure how to approach this. Any help would be greatly appreciated.
The current select list is as follows
<select multiple name="selectItems" size="6" id="selectItems">
<option value="value1" selected="selected">value1</option>
<option value="value2" >value2</option>
<option value="value3" >value3</option>
</select>
<input type=button id="opener" value='Clickme' onclick="showTable(selectItems, 'getquery.php')">
A snippet from the showtable function below, I am basically trying to pass the list (denoted by q) and the location of the page.
xmlhttp.open("GET",page+"?q="+str,true);
xmlhttp.send();