question:I have seen in web sites that on registration page there is no state but if there is selected country USA it will refresh page and show field with list boy states. Do you know how to do it with function? Need help ?
[code=html] <select id="country" name="country" onChange="location.href='http://www.mydomain.com/register.php&country='+this.options[this.selectedIndex].value;"> <option value="1">USA</option> <option value="2">UK</option> </select> [/code]
[code=php] if($_GET['country']==1) { // state drop down goes here } [/code]
$castesql= "select * from caste where religion='$religion' order by caste"; $casters = mysql_query($castesql); $num = mysql_num_rows($casters); if ($num > 0): ?> <select size="1" name="caste"> <option value="0">select</option> <?php while($castearr = mysql_fetch_array($casters)){extract($castearr);?> <option value="<?=$caste?>" <? if($caste1==$caste) echo "selected";?>> <?=$caste?> </option> <?php } ?> </select> <?php else: ?> <font color="red" face=verdana size=1>No caste found.</font> <?php endif; ?>
Help @toplisek spread the word by sharing this article on Twitter...