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

sql - VB.NET Operand type clash: date is incompatible with int error -

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

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -