fixes on addresses

This commit is contained in:
ludo
2024-04-29 22:01:45 +02:00
parent c63bb762ed
commit ee60bac538
14 changed files with 99 additions and 81 deletions

View File

@@ -2,14 +2,24 @@
@push('scripts')
<script>
function initSaveForm(form, sel) {
initValidator();
console.log('ici');
if (typeof initValidator === 'function') {
initValidator();
}
var form = (typeof(form) == 'undefined') ? '#form' : form;
var selector = (typeof(sel) == 'undefined') ? '.save' : sel;
$(selector).off().click(function(e) {
e.preventDefault();
if ($(form).valid()) {
$(this).prop("disabled", true);
$(this).html($(this).data('loading-text'));
if (typeof initValidator === 'function') {
console.log('click');
e.preventDefault();
if ($(form).valid()) {
$(this).prop("disabled", true);
$(this).html($(this).data('loading-text'));
$(form).submit();
} else {
console.log('erreur');
}
} else {
$(form).submit();
}
});