2009-05-22 12:26:07 +00:00

26 lines
648 B
JavaScript

$(document).ready(function(){
$('#frmSurv').submit(function() {
var options = {
target: '#frmSurv',
url: './pages/ajax_surveillance.php',
beforeSubmit: showRequest,
success: showResponse,
timeout: 3000,
};
$(this).ajaxSubmit(options);
return false;
});
function showResponse(responseText, statusText) {
$("#frmSurv").replaceWith('' + responseText + '');
if(statusText == 'success'){
/*Recharger la page*/
}
}
function showRequest(formData, jqForm, options) {
$("#frmSurv").replaceWith('<div id="frmSurv">Mise sous surveillance en cours...</div>');
return true;
}
});