Changing Default Select Value Depending On GET
Posted: Sat Nov 03, 2007 9:22 pm
Using PHP, is there a way that I can change the default value of a select box and a text box?
I just made a search form for a bunch of poems on one of my sites, and it works fine and all, but if you search "Dark" poems including the word "and" , it works fine, but once it loads the search the select form goes back to the first value (which is all poems), and the text area goes blank. Then, someone may forget to change those again so if they search for a new word like... "run", it will search all poetry and not just dark poetry, what they might have expected. If that made any sense...
So, is there any way to change the default value of those depending on GET variables in the url?
I just made a search form for a bunch of poems on one of my sites, and it works fine and all, but if you search "Dark" poems including the word "and" , it works fine, but once it loads the search the select form goes back to the first value (which is all poems), and the text area goes blank. Then, someone may forget to change those again so if they search for a new word like... "run", it will search all poetry and not just dark poetry, what they might have expected. If that made any sense...
So, is there any way to change the default value of those depending on GET variables in the url?