Created
June 6, 2017 19:41
-
-
Save hevertonfreitas/c7559de15686adc9d4172db991fb8666 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('button[type="submit"]').click(function () { | |
$('input:invalid').each(function () { | |
// Find the tab-pane that this element is inside, and get the id | |
var closest = $(this).closest('.tab-pane'); | |
var id = closest.attr('id'); | |
// Find the link that corresponds to the pane and have it show | |
$('.nav a[href="#' + id + '"]').tab('show'); | |
// Only want to do it once | |
return false; | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment