that's the xhtml code
<div style="display: block;" id="regionLocalList">
<div class="itemRegionCountry">
<input type="checkbox" checked="checked" value="1" name="auteur[]" id="aucun">
<label for="tous">no actor</label>
</div>
<div class="itemRegionCountry">
<input type="checkbox" value="3" name="auteur[]" id="3">
<label>others</label>
</div>
<div class="itemRegionCountry">
<input type="checkbox" value="510" name="auteur[]" id="510">
<label for=" Nick">Nick</label>
</div>
<div class="itemRegionCountry">
<input type="checkbox" value="509" name="auteur[]" id="509">
<label for="Craver">Craver</label>
</div>
that's the check/uncheck jquey code
var othercheckboxes = $("#regionLocalList .itemRegionCountry input:not(#aucun)");
var aucun = $("#aucun");
$("#regionLocalInput").click(function(event) {
$("#regionLocalList").toggle();
})
$(aucun).click(function(event) {
$(aucun).attr('checked',true);
$(othercheckboxes).attr('checked',false);
});
$(othercheckboxes).click(function(event) {
if (this.checked){
$(aucun).attr('checked',false);
}
$(othercheckboxes).each(function (i) {
if ($(this).is(':checked')) {
$(aucun).attr('checked',false);
return false;
}
else
{
return $(aucun).attr('checked',true);
}
});
});
After adding the new input via a jqueryUI dialog, I retrieve the same xhtml above with a new input, after that I update the #regionLocalList div with html returned with ajax:
$("#regionLocalList").replaceWith(html);
the new input appeared but the event doesn't work