fixes on addresses
This commit is contained in:
@@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user