OK GRACIAS POR EL INTERES VERAS
TENGO ESTO EN PHP
Código PHP:
<?php
$country = $state = $city = null;
include("conexion.php");
if(isset($_GET["country"]) && is_numeric($_GET["country"])){
$country = $_GET["country"];
echo $country;
}
if(isset($_GET["state"]) && is_numeric($_GET["state"])){
$state = $_GET["state"];
echo $state;
}
if(isset($_GET["region"]) && is_numeric($_GET["region"])){
$city = $_GET["region"];
echo $city;
}
if(isset($_GET["state1"]) && is_numeric($_GET["state1"])){
$city1 = $_GET["state1"];
echo $city1;
}
?>
<form name="theForm" method="get" >
<p>
<!-- COUNTRY SELECTION BASED ON REGION VALUE -->
<select name="country" onChange="this.form.submit()">
<option value="null">Seleccione...</option>
<?php
//POPULATE DROP DOWN MENU WITH COUNTRIES FROM A GIVEN REGION
$sql = "SELECT * FROM select_1";
$countries = mysql_query($sql,$conexion);
while($row = mysql_fetch_array($countries))
{
echo ("<option value=\"$row[id]\" " . ($country == $row["id"] ? " selected" : "") . ">$row[opcion]</option>");
}
?>
</select>
<?php
?>
<br>
<br>
<?php
if($country != null && is_numeric($country))
{
?>
<select name="state" onChange="this.form.submit()">
<option value="null">Seleccione...</option>
<?php
//POPULATE DROP DOWN MENU WITH STATES FROM A GIVEN REGION, COUNTRY
$sql = "SELECT * FROM select_2 WHERE relacion = $country ";
$states = mysql_query($sql,$conexion);
while($row = mysql_fetch_array($states))
{
echo ("<option value=\"$row[id]\" " . ($state == $row["id"] ? " selected" : "") . ">$row[opcion]</option>");
}
?>
</select>
<select name="state1" onChange="this.form.submit()">
<option value="null">Seleccione...</option>
<?php
//POPULATE DROP DOWN MENU WITH STATES FROM A GIVEN REGION, COUNTRY
$sql1 = "SELECT * FROM select_4 WHERE relacion = $country ";
$states1 = mysql_query($sql1,$conexion);
while($row1 = mysql_fetch_array($states1))
{
echo ("<option value=\"$row1[id]\" " . ($state1 == $row1["id"] ? " selected" : "") . ">$row1[opcion]</option>");
}
?>
</select>
<?php
}
?>
<br>
<br>
<?php
if($state != null && is_numeric($state) && $country != null)
{
?>
<select name="region" onChange="this.form.submit()">
<option value="null"></option>
<?php
//POPULATE DROP DOWN MENU WITH CITIES FROM A GIVEN REGION, COUNTRY, STATE
$sql = "SELECT * FROM select_3 WHERE relacion = $state ";
$cities = mysql_query($sql,$conexion);
while($row = mysql_fetch_array($cities))
{
echo ("<option value=\"$row[id]\" " . ($city == $row["id"] ? " selected" : "") . ">$row[opcion]</option>");
}
?>
</select>
<?php
}
?>
</p>
<p> </p>
<p>
<input type="submit" name="f" id="f" value="Enviar" />
</p>
</form>
LO QUE QUISIERA ES QUE CON ESPERE AL TERMINAR DE CARGAR LOS SELECTS PARA PODER ENVIAR LOS DATOS CON EL BOTON NO ANTES GRACIAS