'Data retention' in forms
Posted: Fri Apr 16, 2010 5:26 am
I am not sure what this thing is called, in layman terms I can think of calling it 'form data retention':
I have a search page on my website, the search options appears at the top of the page, when someone selects his/her options and do a search, the page redirects to itself, performs some sorting and filtering, and finally displays results below the search options (yes, the search options will show up again at the top of the page, for users to do another search). This is a full reload of the page, not AJAX reload for the results.
The problem here is that the search form has ALOT of options that users can specify in their search, and if they are going to have to re-select all options everytime they perform a search, its horribly inefficient and definately turns people off. What I'm trying to do is to retain user selected options in checkboxes, drop down lists and radio buttons on my form, even after they click on the search button and the page reloads. In other words, the search form retains all the the user selected options from their previous search.
What I am doing now is grabbing data off the GET parameters in my URL, (i pass my search variables by GET anyway so I am kind of reusing them) and then try to manually check the check boxes, select the radio buttons etc with some javascript. This seems.. Inelegant.. Is there a 'correct way' to do this?
I have a search page on my website, the search options appears at the top of the page, when someone selects his/her options and do a search, the page redirects to itself, performs some sorting and filtering, and finally displays results below the search options (yes, the search options will show up again at the top of the page, for users to do another search). This is a full reload of the page, not AJAX reload for the results.
The problem here is that the search form has ALOT of options that users can specify in their search, and if they are going to have to re-select all options everytime they perform a search, its horribly inefficient and definately turns people off. What I'm trying to do is to retain user selected options in checkboxes, drop down lists and radio buttons on my form, even after they click on the search button and the page reloads. In other words, the search form retains all the the user selected options from their previous search.
What I am doing now is grabbing data off the GET parameters in my URL, (i pass my search variables by GET anyway so I am kind of reusing them) and then try to manually check the check boxes, select the radio buttons etc with some javascript. This seems.. Inelegant.. Is there a 'correct way' to do this?