从下拉列表中保留动态选择的值,但仍可以在提交后查看列表

I have got the following form:

<div id="Quick_find_container">
    <form action="" method="post" target="_self">
        <div id="qcategory_1">Product</div>
            <div id="qcategory">
                <select name="Category" class="dropmenu" id="Category"onchange="this.form.submit()">
                    <option value="">Any</option>
                    <option value="Keyboard"<?php if ($_POST['Category']=="Keyboard") {echo "selected='selected'"; } ?>>Keyboard</option>
                    <option value="Piano"<?php if ($_POST['Category']=="Piano") {echo "selected='selected'"; } ?>>Piano</option>
                </select>
            </div>
            <div id="qbrand_1">Brand</div>
            <div id="qbrand"><select name='Manufacturer' onchange="this.form.submit()">
<?php  
            echo '<option value="">Any</option>';

        $value = $_POST['Manufacturer'];

            while ($row = mysql_fetch_array($RS_Search)) {
                echo "<option value=" . $row['Manufacturer'] . " ' . (selected == $value ? ' selected' : '') . '>" . $row['Manufacturer'] . "</option>";
            }
?>
                </select>
            </div>
            <div id="qsubmit">
                <input name="Search2" type="submit"  id="Search2" value="Submit">
            </div>
        </form>
    </div>
    <?php echo $_POST['Category']; ?>
    <?php echo $_POST['Manufacturer']; ?>

Echo post Category and Manufacturer are purely to see what it is submitting.

My problem is the second drop down menu. I would like to display after something is selected what the selected value was. At the moment it just jumps back to the default value Any even though the out put of POST_[Manufacturer'] is correct. Is there a way to display the selected value like in the first drop down menu? I still would like to keep the values to choose from the database as well. But just display the selected value.

Any help welcome

Your line that echos the option has a lot of problems with quotes. This will fix it:

while ($row = mysql_fetch_array($RS_Search)) {
    $selected = $_POST['Manufacturer'] == $row['Manufacturer'] ? 'selected' : '';
    echo '<option ' . $selected . ' value="' . htmlspecialchars($row['Manufacturer']) . '">' . htmlspecialchars($row['Manufacturer']) . '</option>';
}

Side note: remember to use htmlspecialchars() or similar when outputting variables into HTML to prevent XSS.

In theory the code you have there might work altough i'd had made it like this

while ($row = mysql_fetch_array($RS_Search)) {
    $selected = ($_POST['Manufacturer'] == $row['Manufacturer']) ? 'selected="selected":'';
    echo '<option '.$selected.'>' . $row['Manufacturer'] . '</option>";
}?>

You do not need value if you have the same thing within the tag. Also you were missing some quote marks in your tag. Learn to simplify your code so it's easier to understand.