Hi
Firstly I apologise if this is the wrong forum. The code is a mix of PHP and Javascript, but my overall page is PHP.
What I have is one dropdown box, which depending on what is selected produces the appropriate second dropdown box. This is all great and works beautifully.
What I'm struggling to do is to make the selected options 'sticky'so that they remain in the search form. All my other fields in the form are sticky but I can't work it out for these fields as the second box is always hidden.
When the user clicks on 'submit' these 2 fields default back to 'Please Select'and the second box disappears from view. The user has to reselect every time to do a new search.
<select name="prop_type" onchange="display(this,'Private Apartments','Landed Property', 'Hdb Flat', 'Commercial', 'Hudc Apartments');">
<option selected="selected">Please Select</option>
<option value="Private Apartments">Private Apartments</option>
<option value="Landed Property">Landed Property</option>
<option value="Hdb Flat">Hdb Flat</option>
<option value="Commercial">Commercial </option>
<option value="Hudc Apartments">Hudc Apartments </option>
<option value="invisible">Invisible</option>
</select></td>
</tr>
<tbody id="Private Apartments" style="display: none;">
<tr>
<td colspan="2"><select name="prop_saletype1" id="prop_saletype1">
<?php
do {
?>
<option value="<?php echo $row_prop_apartment['prop_saletype']?>"><?php echo $row_prop_apartment['prop_saletype']?></option>
<?php
} while ($row_prop_apartment = mysql_fetch_assoc($prop_apartment));
$rows = mysql_num_rows($prop_apartment);
if($rows > 0) {
mysql_data_seek($prop_apartment, 0);
$row_prop_apartment = mysql_fetch_assoc($prop_apartment);
}
?>
</select></td>
</tr>
</tbody>
<tbody id="Landed Property" style="display: none;">
<tr>
<td colspan="2"><select name="prop_saletype2" id="prop_saletype2">
<?php
do {
?>
<option value="<?php echo $row_prop_landed['prop_saletype']?>"><?php echo $row_prop_landed['prop_saletype']?></option>
<?php
} while ($row_prop_landed = mysql_fetch_assoc($prop_landed));
$rows = mysql_num_rows($prop_landed);
if($rows > 0) {
mysql_data_seek($prop_landed, 0);
$row_prop_landed = mysql_fetch_assoc($prop_landed);
}
?>
</select></td> </tr>
</tbody>
Any help would be great! Many thanks liz