2011-07-01 22:33:03 +02:00
|
|
|
|
$(document).ready(function () {
|
|
|
|
|
var options = {
|
|
|
|
|
target: '#result',
|
2011-08-08 23:50:48 +02:00
|
|
|
|
//beforeSubmit: showRequest,
|
|
|
|
|
//success: showResponse,
|
2011-07-01 22:33:03 +02:00
|
|
|
|
type: 'post',
|
|
|
|
|
resetForm: false
|
|
|
|
|
};
|
|
|
|
|
$('#form').ajaxForm(options);
|
2011-08-05 06:38:18 +02:00
|
|
|
|
$('#save_button').removeAttr('disabled');
|
2011-07-01 22:33:03 +02:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function showRequest(formData, jqForm, options) {
|
|
|
|
|
$("#result").empty().html('Saving...');
|
|
|
|
|
$("#form :input").attr("disabled", true);
|
|
|
|
|
$('#saveAjax').show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function showResponse(responseText, statusText, xhr, $form) {
|
|
|
|
|
$("#result").empty().html(responseText);
|
|
|
|
|
$("#form :input").attr("disabled", false);
|
|
|
|
|
$('#saveAjax').hide();
|
|
|
|
|
}
|