Révision 78bae9a3
Ajouté par Jérôme Schneider il y a presque 10 ans
calebasse/static/js/calebasse.dialog.js | ||
---|---|---|
77 | 77 |
} |
78 | 78 |
|
79 | 79 |
/** |
80 |
* Transform form(s) into your id to ajax forms |
|
80 |
* Transform form(s) to ajax forms |
|
81 |
* id: jQuery id where you want to replace form by ajaxForm |
|
81 | 82 |
*/ |
82 | 83 |
function calebasse_ajax_form(id) { |
83 | 84 |
function onsuccess(response, status, xhr, form) { |
84 |
$(id).html(response); |
|
85 |
$('form').ajaxForm({ |
|
86 |
success: onsuccess, |
|
87 |
}); |
|
85 |
if ($('.errorlist', response).length != 0) { |
|
86 |
$(id).html(response); |
|
87 |
$('form').ajaxForm({ |
|
88 |
success: onsuccess, |
|
89 |
}); |
|
90 |
} |
|
91 |
else { |
|
92 |
window.location.reload(true); |
|
93 |
} |
|
88 | 94 |
} |
89 | 95 |
$('form').ajaxForm({ |
90 | 96 |
success: onsuccess, |
Formats disponibles : Unified diff
dossiers: fix MISES in health tab and replace FilteredSelect by select2
warning: new dependency on django-select2