CodeIgniter Forums
Help about prefill in my select - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Help about prefill in my select (/showthread.php?tid=41743)



Help about prefill in my select - El Forum - 05-16-2011

[eluser]Wondering Coder[/eluser]
I've been working on my application for quite a while now and I have many forms in it. My problem is when a form is submitted it prefill or display the menu item that I select but when I refresh the page it return to my first option.

Code:
<select name="myselect">
<option value="">Choose one</option>
<option value="one" &lt;?php echo set_select('myselect', 'one'); ?&gt; >One</option>
<option value="two" &lt;?php echo set_select('myselect', 'two'); ?&gt; >Two</option>
<option value="three" &lt;?php echo set_select('myselect', 'three'); ?&gt; >Three</option>
</select>

What I want is even if I refresh the page it will still display the selected item.


Help about prefill in my select - El Forum - 05-16-2011

[eluser]osci[/eluser]
Don't double post. People don't like it.

If you mean by refreshing hitting F5 for example, then no.