I don't use client side scripting of any kind anymore, and if I was doing this, and wanted this type of behavior, instead of a <SELECT> dropdown, I would use either an array of submit buttons, each with a different choice, or a bunch of hyperlinks, one per choice, each one passing the value for that id in the query string.
When I want to retain the values of an in progress form, I grab all the post and get values, and store them in an array. When I'm displaying the form, each element is either blank, or has a value. something like this..
$arr_form['txt_user_name'] = $_POST['txt_user_name'];
$arr_form['txt_user_name'] = "";
echo "<INPUT type = 'text' name = 'txt_user_name' value = '" ;
Code: Select all
I hope that makes sense, and helps you a bit.