|
-
June 12th, 2010, 08:18 AM
#1
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");
if (mysql_num_rows ($result)) {
echo "<SELECT name=\"import_category\">\n";
echo "<OPTION value=\"\">- choose category -</OPTION>\n";
echo "<OPTION value=\"\"></OPTION>\n";
while ($s = mysql_fetch_array ($result)) {
echo "<OPTION value=\"$s[cs_category_id]\">";
for ($i = 2; $i <= $s['cs_category_level']; $i++) echo " ";
echo "$s[cs_category_title]</OPTION>\n";
}
echo "</SELECT>\n";
}
?>
That code is not written by me. It's a direct copy of the webshop of the importing tool.
What I should do? Remember also that I don't know much about php...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|