G'day everyone.
I have a registration page that has a state and country field.
If the country selected is Australia then a drop-list with Australian states is visable. If any other country is selected then a text field is visable.
This is all working through a javascript validation script and a static country drop list but when I change the country drop list to be populated from a MySQL list then it stops working and both fields are visable.
[See attached working file}
But if I change the "country_streetAddress" to pull the list from a MySQL database, it stops working and both boxes appear
<label>Country*:</label>
<select name="countryField" id="country_streetAddress" style="width:110px;">
<?php
do {
?>
<option value="<?php echo $row_countries['countryName']?>"<?php if (!(strcmp($row_countries['countryName'], "Australia"))) {echo "selected=\"selected\"";} ?>><?php echo $row_countries['countryName']?></option>
<?php
} while ($row_countries = mysql_fetch_assoc($countries));
$rows = mysql_num_rows($countries);
if($rows > 0) {
mysql_data_seek($countries, 0);
$row_countries = mysql_fetch_assoc($countries);
}
?>
</select>
Thanks