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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -