Ver Mensaje Individual
  #4 (permalink)  
Antiguo 11/11/2011, 06:30
Avatar de Rappa
Rappa
 
Fecha de Ingreso: noviembre-2011
Ubicación: Montevideo, Uruguay
Mensajes: 80
Antigüedad: 12 años, 5 meses
Puntos: 13
Respuesta: sencillo pero ¿porque no me funciona?

Tienes que hacer una funcion con el código y ejecutarla en el body onLoad

Código Javascript:
Ver original
  1. function MiFuncion(){
  2.    if(document.forms.length > 0) {
  3.       for(var i=0; i < document.forms[0].elements.length; i++) {
  4.          var campo = document.forms[0].elements[i];
  5.          if(campo.type != "hidden") {
  6.             campo.focus();
  7.             break;
  8.          }
  9.       }
  10.    }
  11. }

y en el body:

Código HTML:
Ver original
  1. <body onLoad="MiFuncion();>"
__________________
Drugs and alcohol are not the answer
Unless you are asking what i'm doing this weekend