Created
September 11, 2012 20:50
-
-
Save asimpson/3701936 to your computer and use it in GitHub Desktop.
Validation + Popover
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
if( !Modernizr.formvalidation ){ | |
var sb_formValidation = $('.content form, .search-container form, .support-search form'); | |
H5F.setup(sb_formValidation); | |
$(sb_formValidation).find('[required]').popover({ | |
placement:'bottom', | |
title:'Required!', | |
content:"Please fill out this field.", | |
trigger: "manual" | |
}); | |
$(sb_formValidation).on('submit', function(){ | |
$(this).find('.required:first').popover('show'); | |
}); | |
$('[required]').on('focus', function(){ | |
$(this).popover('hide'); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment