hi everyone. I got this jquery code which is working just fine. Except on element I load after the page is ready.
$('.reply').click(function(){
ele = $(this).attr('title');
$('#'+ele).load('ajax/form_post.php');
$('#'+ele).show();
return false;
});
$('.add_com form').submit(function(){
ele = $(this);
$.post('ajax/com.php',
{ info : ele.parents('.add_com').attr('title'),
texte : ele.find('textarea').val(),
},
function(data) {
if(data == 'fuck'){
alert('erreur');
}
else{
ele.parents('.add_com').append(data);
}
});
return false;
});
after I loaded the form clicking on the add_com form doesn't work. It works on form already loaded though...