One last question. Looking at the following code again(its the same code expanded a bit). How can i make it so if The state_province field is EMPTY it makes that WHole field DIssappear entirely?
<?
include("config.php");
$objConn=mysql_connect($Host,$DBUser,$DBPass);
mysql_select_db($DBName2,$objConn);
$showcountry=${"showcountry"};
if ($showcountry=="")
{
$showcountry=224;
}
else
{
$showcountry=intval($showcountry);
}
?>
<script>
function swapit(id){
document.regform.showcountry.value = id
document.regform.action = "seltest.php"
document.regform.submit()
}
</script>
<form name="regform" method="post" action="somefile.php">
<input type="hidden" name="showcountry" value="<? echo ${"showcountry"}; ?>">
<Select name="country" onchange="swapit(this.options[this.options.selectedIndex].value)">
<option value="-1"> chose a country </option>
<?
$res_query=mysql_query(("Select * from country"),$objConn);
$res=mysql_fetch_array($res_query);
while(!($res==0))
{
$countryid=$res["id"];
$countryname=$res["countryname"];
?>
<option value="<? echo $countryid; ?>" <? if ($countryid==$showcountry)
{ $currentcountry = $countryname;
?>selected<? } ?>><? echo $countryname; ?></option>
<?
$res=mysql_fetch_array($res_query);
}
?>
</select>
<? if ($showcountry!="")
{
?>
<Select name="state_province">
<?
$res_query=mysql_query(("Select * from state_province where countryid = '".$showcountry."'"),$objConn);
$res=mysql_fetch_array($res_query);
while(!($res==0))
{
$areaid=$res["id"];
$state_province=$res["state_province"];
$countryid=$res["countryid"];
?>
<option value="<? echo $state_province; ?>"><? echo $state_province; ?></option>
<?
$res=mysql_fetch_array($res_query);
}
?>
</select>
<? } ?>
<?=$currentcountry?>
</form>
<?
mysql_close($objConn);
?>