jqtransform form selector (onchange) problem !!!!
Posted
by Newbie
on Stack Overflow
See other posts from Stack Overflow
or by Newbie
Published on 2010-05-05T12:06:48Z
Indexed on
2010/05/05
13:38 UTC
Read the original article
Hit count: 417
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
© Stack Overflow or respective owner