function getArticleBatiment(obj){ if (this != window) { myobj = this; } else if(obj != undefined) { myobj = obj; } contentdiv('remove'); contentdiv('insert'); var actualite = myobj.actualite_id; var batiment = myobj.batiment_id; var logged = myobj.logged; new Ajax.Updater('content_div_value', 'inc_ajax/inc_batimentActualite.php', { evalScripts: true, parameters: 'actualite_id='+actualite+'&batiment_id='+batiment, onComplete: function(){ if(logged == 'logged'){ $('comment_submit').enable(); } } }); } function comment_submit(){ var comment = $F('comment'); var actualite_id = $F('actualite_id'); var super_id = $F('super_id'); if (comment != ''){ new Ajax.Request('inc_ajax/action_actualites.php', { evalScripts : true, parameters : 'action=comment_insert&comment='+comment+'&actualite_id='+actualite_id+'&super_id='+super_id, onComplete: function(transport){ var response = transport.responseText; if (response == '0'){ $('error').update(trad['identificationincorrecte']); } else{ $('noerror').update(trad['commenttovalidate']); $('comment').value = ''; $('comment_submit').disable(); } } }); } else{ $('error').update(trad['formulaireincomplet']); } }