Hey guys,
I would like to change the webpage when someone changes the select input and then clicks Go.
Unfortunately I've not been able to with jQuery, here's what I have now, but I would like to use jQuery.
HTML:
<select id="productlist"> | |
<option value="">Select a product...</option> | |
<option value="/products/2/C">C</option> | |
<option value="/products/1/H">HC</option> | |
</select> | |
<input type="button" value="Go" onclick="goTo();"> |
JAVASCRIPT:
function goTo() { var sE = null, url; if(document.getElementById) { sE = document.getElementById('productlist'); } else if(document.all) { sE = document.all['productlist']; } if(sE && (url = sE.options[sE.selectedIndex].value)) { location.href = url; } }
Thanks!!