[thelist] input type focus with javascript

Michael Robertson mike at mikeemedia.com
Tue Nov 26 14:08:05 CST 2002


trying to write a function that will set focus to first form element that is
not a hidden input. This is not working but also not producing an error. any
suggestion?

function setFocus(){
 for(var i=0;i< document.forms[0].elements.length;i++){
  if(document.forms[0].elements.type != 'hidden'){
   document.forms[0].elements.focus();
   break;
  }
 }
}





More information about the thelist mailing list