Skip to content

Instantly share code, notes, and snippets.

@asimpson
Created September 11, 2012 20:50
Show Gist options
  • Save asimpson/3701936 to your computer and use it in GitHub Desktop.
Save asimpson/3701936 to your computer and use it in GitHub Desktop.
Validation + Popover
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