jqtransform form selector (onchange) problem !!!!
- by Newbie
I'm styling a form with Jqtransform script.
The form includes a selector which enlist some cities, when i click a one, it should update the selector below it with some locations within that city.
here is the code of the selector
<select name="city" id="city" class="wide" onchange="populateDestrict(this)">
It was working fine with default style , but after applying JQ, it lost it's functionality
I asked a question before here LINK
and i did as Dormilich did by writing:
$(function() {
$("form.jqtransform").jqTransform();
$("#city").change(populateDestrict(this));
});
But it didn't work !
here is also the code of the function if it helps
<script language="javascript">
function populateDestrict(obj){
var city=obj.value;
if(city!=""){
$.post('city_state.php',{ city: city},function(xml){
$("#state").removeOption(/./);
$("district",xml).each(function() {
$("#state").addOption($("key",this).text(), $("value",this).text());
});
});
}
}
</script>
Any help people ????????
Thanks