Click to See Complete Forum and Search --> : maintain selected value of a dropdown box after reload


umesh.awasthi
10-18-2008, 03:12 AM
Hi All,

i have a user registration page where there is a drop down for security question
if there is any error while submitting the page the selected values of the drop down is getting changed i want that even after thr form reload the value in the drop down must be the same as selected by the user while filling the form how can i do that

Thanks in advance
umesh

beahawk
10-19-2008, 10:13 AM
HTML is just a markup language.

It has no memory of what has happened on previous pages.

You need to send the information using something like php or something similar.

Your form has an action - this will most likely be sending the data in the form to a script which processes that data.

bourkey08
10-19-2008, 10:27 AM
once your form submits the value to php you could have php store it as a cookie and then write it again when the page reloads. This could probably be done with javascript as well.

subit
10-30-2008, 04:01 AM
I have a similiar problem i want to get an fix for.
I want a dropdown box with the names for a couple of radiostations and a "play"-button that connects to the choosen radiostation and i want the dropdown to remember the radiostation last choosed. How do i do? Worth saying is, im still a scriptnewbee ;)