Решил проблему, не так как хотелось конечно, но на первое время сойдет, выкладываю решению, может кому-то пригодится:
<select id="country" name="country">
<option>Выберите страну...</option>
{foreach $row_country as $country}
<option {if $country.country_id == $smarty.get.country} selected {/if} value="{$country.country_id}">{$country.name}</option>
{/foreach}
</select>
<select id="region" name="region">
<option>Выберите регион...</option>
{foreach $row_region as $region}
<option {if $region.region_id == $smarty.get.region} selected {/if} value="{$region.region_id}">{$region.name}</option>
{/foreach}
</select>
<select id="city" name="city">
<option>Выберите город...</option>
{foreach $row_city as $city}
<option value="{$city.id}">{$city.name}</option>
{/foreach}
</select>
$('#country').change( function() {
var country = $('#country').val();
$.ajax({
type: "GET",
url: "index.php?option=registration&country="+country,
data: country,
success: function(data) {
document.location.href = "index.php?option=registration&country="+country;
}
});
});
$('#region').change( function() {
var region = $('#region').val();
var country = $('#country').val();
$.ajax({
type: "GET",
url: "index.php?option=registration&country="+country+"®ion="+region,
data: region,
success: function(data) {
document.location.href = "index.php?option=registration&country="+country+"®ion="+region;
}
});
});
class Registration extends Core {
public function getContent() {
global $mysqli;
global $smarty;
$res = $mysqli->query("SELECT * FROM country ORDER BY name");
if ($res->num_rows > 0) {
for ($i=0; $i<$res->num_rows; $i++) {
$row_country[] = $mysqli->assoc($res);
}
$smarty->assign("row_country", $row_country);
$smarty->assign("country", $_POST['country']);
}
$res_region = $mysqli->query("SELECT * FROM region WHERE country_id=".$_GET['country']." ORDER BY name");
if ($res_region->num_rows > 0) {
for ($j=0; $j<$res_region->num_rows; $j++) {
$row_region[] = $mysqli->assoc($res_region);
}
$smarty->assign("row_region", $row_region);
}
$res_city = $mysqli->query("SELECT * FROM city WHERE region_id=".$_GET['region']." ORDER BY name");
if ($res_city->num_rows > 0) {
for ($j=0; $j<$res_city->num_rows; $j++) {
$row_city[] = $mysqli->assoc($res_city);
}
$smarty->assign("row_city", $row_city);
}
}
}
laimas держи +, помог