javascript - For more than one text boxes in a tab not working -


for more 1 textboxes in tab following example not working.

code

jsfiddle.

$(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

Popular posts from this blog

SVG stroke-linecap doesn't work for circles in Firefox? -

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -