Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/05/2012, 13:52
computer_si
 
Fecha de Ingreso: febrero-2011
Mensajes: 85
Antigüedad: 13 años, 2 meses
Puntos: 3
No toma foco Input

Hola a todos, a ver si alguien me puede ayudar, tengo el siguiente codigo:

Código:
xmlhttp=new ConstructorXMLHttpRequest();
xmlhttp.onreadystatechange=function(){

if (xmlhttp.readyState==4 && xmlhttp.status==200){
document.getElementById("cuerpo").innerHTML=xmlhtt p.responseText;

var frm = document.getElementById('nombre');
alert(frm);
frm.focus();

}
}

xmlhttp.open("POST",openProg, true);
xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlhttp.send(queryString);

return false;
Tal y como esta si me funciona, el campo nombre toma el foco despues de que le doy aceptar al alert.

Pero si quito el alert, el campo nombre nunca toma el foco y lo mas raro es que no me marca ningun error.

Gracias anticipadas y Saludos

Última edición por computer_si; 21/05/2012 a las 13:58