javascript - How to focus fist input field in the active navigation tab in angular bootstrap ui? -


how focus fist input field in active tab? next tab becomes active programmatically, after activates first input has selected. using angular js bootstrap ui

i have had todo sounds same.

to change tab

 <button class="btn btn-default btn-sm"           ng-click="tabs[0].active = true">select second tab</button> 

from https://angular-ui.github.io/bootstrap/#/tabs

if static html5 attribute may work

<input type="text" name="fname" autofocus> 

mine dynamic did (and, dident know html5 thing when did this)

.factory('focus', function($timeout) {         return function(id) {             $timeout(function() {                 var element = document.getelementbyid(id);                  if (element)                     element.focus();             });         };     }) 

and call code, had todo had code change made showup.


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -