extranet/includes/surveillance/script-ajax.js

31 lines
792 B
JavaScript
Raw Normal View History

2009-05-20 15:49:08 +00:00
$(document).ready(function(){
$("input[type=checkbox][name=surveillance]").change(function() {
if($(this).attr('checked')== true){
$("#survForm").css('display','block');
}else{
$("#survForm").css('display','none');
}
});
$('#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 + '');
}
function showRequest(formData, jqForm, options) {
$("#frmSurv").replaceWith('<div id="frmSurv">Mise sous surveillance en cours...</div>');
return true;
}
});