title: Appcelerator - Checking which textfield has focus
body: <p>I have a keyboard toolbar setup with a PREVIOUS and NEXT button. I'm trying to figure out which textfield has focus so I can allow the user to jump to the next field or go back to the previous field. My code currently looks like this:</p>
  
  <pre><code>//Setup keyboard toolbar.
  var flexSpace = Titanium.UI.createButton({
      systemButton:Titanium.UI.iPhone.SystemButton.FLEXIBLE_SPACE
  });
  
  var navButtons = Titanium.UI.createButtonBar({
      labels:['Previous','Next'],
      backgroundColor:'#336699',
      top:100,
      style:Titanium.UI.iPhone.SystemButtonStyle.BAR,
      height:25,
      width:'auto'
  });
  
  navButtons.addEventListener('click',function(e){
      // Previous Button, index 0.
      Titanium.API.info(e.index);
      if (e.index == 0){
          if (nameTxt.hasFocus == "nameTxt"){
              phoneTxt.focus();
          }
      }
  
      // Next Button, index 1.
      if (e.index == 1){
          if (nameTxt.hasFocus){
              nameTxt.hasFocus = false;
              phoneTxt.hasFocus = true;
          }/*else{
              done.fireEvent('click');
          }*/
      }
  
  }); 
  </code></pre>
  
  <p>I think I'm close to getting this working, so just need the final push. Any help appreciated. </p>
  
  <p>Regards,
  Stephen</p>