
January 15th, 2013, 05:38 PM
|
|
Contributing User
|
|
Join Date: Dec 2012
Posts: 64
Time spent in forums: 11 h 36 m 11 sec
Reputation Power: 1
|
|
|
[Solved] Keep Select Input Option On Page Change
I understand the basics, but I'm not fluent with JS yet. Is there a function that will keep the option selected displayed in the select input on page changes?
Code:
<form action="" method="POST">
<select name="imgCategory" size=1 onChange="this.form.submit()">
<option value=""></option>
<option value="">All Images</option>
<option value="Amazing">Amazing</option>
<option value="Funny Animals">Funny Animals</option>
<option value="Funny Cartoon">Funny Cartoon</option>
<option value="Funny People">Funny People</option>
<option value="Gross">Gross Pictures</option>
<option value="Random">Random</option>
<option value="Stupid People">Stupid People</option>
</select>
</form>
For example, if I select "Funny People" I would like "Funny People" to be displayed in the select input if the page changes.
SOLVED: Ended up creating a PHP function containing a switch statement.
|