Wanto to keep drop down value selected after submit
I have a webshop. I have a little problem in the admin side.
There's a text field what is written in the sql database after pressing submit. Also there's drop down menu where I have to select product category where I information should be send. At this moment drop down menu has 1156 categories.
Let's say I want to export information to the category 890. I search category 890 in the list and press submit. Now page will be refreshed and now drop down menu doesn't remember what I selected before. Again I have to open drop down menu and search next category 891 and submit staff there. Now page will be refreshed and now drop down menu has again default value which is "Select". And again again again I have to scroll down to find 892.
I want that list remembers it's value after submit is pressed.
You know what I mean?
List of the menu is generated like this:
PHP Code:
<?php
$result = mysql_query ("SELECT * FROM $clover_shop_categories WHERE cs_category_title IS NOT NULL ORDER BY cs_category_listing_position asc");
Re: Wanto to keep drop down value selected after submit
Two possibilities.
1. The original code doesn't have the single quotes around cs_category_I'd. Try removing them from both lines.
2. Since you didn't post the form, I just guessed that it used POST and not GET.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
Re: Wanto to keep drop down value selected after submit
Originally Posted by PeejAvery
Two possibilities.
1. The original code doesn't have the single quotes around cs_category_I'd. Try removing them from both lines.
2. Since you didn't post the form, I just guessed that it used POST and not GET.
YOUR'E THE MAN!!!
I removed single quotes of
echo "<OPTION value=\"$s['cs_category_id']\"$selected>";
and it worked perfectly!!! Thank you so very much. If you some day come here in Finland I will offer you a beer.
Bookmarks