diff --git a/etemplate/js/etemplate.js b/etemplate/js/etemplate.js index 7d9cd2d10b..6f52ea4b1b 100644 --- a/etemplate/js/etemplate.js +++ b/etemplate/js/etemplate.js @@ -9,6 +9,20 @@ * @version $Id$ */ +/** + * Handle HTML5 validation on tabs + */ +jQuery().ready(function() { + jQuery('.tab_body :input').bind('invalid', function(e) { + // Activate the appropriate tab + var tab = jQuery(this).parentsUntil('.tab_body').last(); + var alltabs = [tab.attr("id")]; + tab.siblings('div').each(function() { + alltabs.push(this.id); + }); + activate_tab(tab.attr("id"), alltabs.join('|')); + }); +}); function submitit(form,name) { //alert(name+' pressed');