javascript - For more than one text boxes in a tab not working -
for more 1 textboxes
in tab following example not working.
code
$(document).on('click', 'button[name="save"]', function() { var tabs = $('.tab-pane input'); $('.nav.nav-tabs li,.tab-pane').removeclass('active'); var bool = false; $.each(tabs, function(index, value) { if ($(this).val().length <= 0) { $('ul.nav li:eq(' + index + ')').addclass('active'); $('.tab-content .tab-pane:eq(' + index + ')').addclass('active'); $(this).focus(); return false; } }); return false; });
the reason example dosent work because trying access inputs based on tabs index. once add more inputs tab li:eq(' + index + ') not apply class active other inputs. however, shouldn't confusing user if more 1 input marked active @ time.
Comments
Post a Comment