I’ve got a page with a form that’s just a dropdown to show X items per page. It defaults to 5.
<form class="rppForm" style="width:110px;" name="reviewsPerPage" method="POST" action="/rpp.php" return false;">
<select name="reviewsPerPage" style="padding-right: 25px; float: left;">
<option value="5">5</option>
<option value="10">10</option>
<option value="15">15</option>
<option value="25">25</option>
</select>
<input type="submit" value="Okay" name="submit" id="rPP">
</form>
This works fine. It sends the information to “rpp.php” and sets a few other variables, then returns to the original page with some variables in the query string, say http://www.page.com/?dropdown=15&foo=bar
Everytime I dynamically adjust the content on the page ?dropdown=15&foo=bar stays in the query string, but the dropdown shows “5”.
Is there away to make the drop down always show the value from the query string by default?
Something like this should work: