add UI error handler for form with tabs
This commit is contained in:
parent
a711ca58fc
commit
fa7fcd5022
|
@ -8,4 +8,26 @@ module.exports = function() {
|
||||||
.find('.custom-file-label')
|
.find('.custom-file-label')
|
||||||
.html(inputFile.files[0].name);
|
.html(inputFile.files[0].name);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('.nav a').each(function() {
|
||||||
|
const link = $(this)
|
||||||
|
const href = link.attr('href')
|
||||||
|
|
||||||
|
if (href.substr(0, 1) !== '#') {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(href)
|
||||||
|
|
||||||
|
const tab = $('.tab-pane ' + href)
|
||||||
|
|
||||||
|
if (!tab.length) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tab.find('.form-error-message').length) {
|
||||||
|
link.addClass('border border-danger')
|
||||||
|
link.click()
|
||||||
|
}
|
||||||
|
})
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue