When someone selects an item in a dropdown, I want to reload the current page with the value of the ID in the selected item in the querystring like:
http://www.example.com/mypage?id=234
How can I do this?
<select id="items" onselect="javascript:reloadPage(this)">
<option name="item1">Item 1</option>
</select>
script:
function reloadPage(id) {
document.location.href = location.href + '?id=' + id.value;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With