jqtransform and 2 levels of ajax dynamic content not firing

200 views Asked by At

The first step of ajax work perfectly when I select an option from the #country that as been transformed from jqtransform so ("div.jqTransformSelectWrapper ul li a").

Here is the original simplified html code:

<select  name="country" id="country"></select>
<span id='province_bloc' class='inline_block'></span>
<span id='ville_bloc' class='inline_block'></span>

Here is also the original jquery code that is inside $(function(){});

$("div.jqTransformSelectWrapper ul li a").click(function(){
clicked = $(this).parents(".jqTransformSelectWrapper").children("select").attr("id");
alert(clicked);
if(clicked=="country" && isset($("form #province_bloc").attr("id")))
{
loadContent("province","country");
fix_select("#province");
}
if((clicked=="country" || clicked=="province") && isset($("form #ville_bloc").attr("id")))
{
loadContent("ville","province");
fix_select("#ville");
}
});

The 2 other span (#province_bloc, #ville_bloc) are also transformed. But when I try to click into the dynamicly created select into province_bloc, nothing happen.

I have tried all of these (I use jquery-1.7.1):

$("div.jqTransformSelectWrapper ul li").delegate('a', 'click', function(){
alert("test"); 
});

$(document).on("click", "div.jqTransformSelectWrapper ul li a", function(){
alert("test"); 
});
0

There are 0 answers