Hello everyone, I'm trying to finetune my search option as following. I want multiple dropdownboxes next to eachother so the customer will pick his choice rather than type himself.
For example:
first dropdown options= nike, adidas, puma
2nd dropdown options= runningshoe, tennisshoe, fitnessshoe
3d dropdown options= cheap, expensive
I found the following solution for a bit of it:
html:
With searchdrop.js:Code:<table> <tr> <td> <select id="SBox0"> <option value=" ">Kies</option> <option value="Nike">Nike</option> <option value="Addis">Addis</option> <option value="Rockport">Rockport</option> </select> </td> <td> <select id="SBox1"> <option value=" ">Kies</option> <option value="Sport shoe">Sport shoe</option> <option value="Walking shoe">Walking shoe</option> <option value="Running shoe">Running shoe</option> </select> </td> <td> <select id="SBox2"> <option value=" ">Kies</option> <option value="2007">2007</option> <option value="2008">2008</option> <option value="2009">2009</option> </select> </td> </tr> </table> <button onclick="ShowSelections()">Search</button> <script type="text/javascript" src="searchdrop.js"></script>
What this does is the following, it takes the dropdownmenu items, places them next to eachother and gives an alert.Code:function NewList(selObj,newObj) { var selElem = document.getElementById(selObj); var selIndex = selElem.selectedIndex; var newElem = document.getElementById(newObj); var tmp = ''; newElem.options.length = 0; for (var i=0; i<selElem.options.length; i++) { tmp = selElem.options[i].value; if (i != selIndex) { newElem.options[newElem.options.length] = new Option(tmp,tmp); } } } function ShowSelections() { alert(document.getElementById('SBox0').value +' '+document.getElementById('SBox1').value +' '+document.getElementById('SBox2').value); // replace alert with storage to hidden element (?) for searching purposes. }
But instead of the alert, I want it to fill it into a zen searchbox.(if possible preferably invisible so the customer only sees the dropdownmenu's)
Anyone have any idea how to do this?
Thanks in advance!
DMR







Bookmarks