$(document).ready(function(){ //Boite de dialog surveillance $('.dialogsurv').live('click', function(){ var title = $(this).attr('title'); var href = $(this).attr('href'); var dialogOpts = { bgiframe: true, title: title, width: 500, height: 350, modal: true, open: function(event, ui) { $(this).html('Chargement...'); $(this).load(href); $('#dialogsurv').keypress(function(e){ if (e.keyCode == 13){ e.preventDefault(); survSubmit(); } }); }, buttons: { Ok: function() { survSubmit(); }, Annuler: function() { $(this).dialog('close'); } }, close: function() { $('#dialogsurv').remove(); } }; $('
').dialog(dialogOpts); return false; }); }); function survSubmit(){ var buttons = $('#dialogsurv').dialog('option','buttons'); for( var button in buttons ){ $(":button:contains('"+button+"')").attr('disabled','disabled'); } var formAction = $('#frmSurv').attr('action'); var href = window.location.href; var serData = $('#frmSurv').serialize(); $('#frmSurv').replaceWith('