Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/05/2012, 18:53
computer_si
 
Fecha de Ingreso: febrero-2011
Mensajes: 85
Antigüedad: 13 años, 2 meses
Puntos: 3
Solo toma el foco con Alert

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

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();
break;



}
}

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 quieto el alert, el campo nombre nunca toma el foco y no me marca ningun error.

Gracias anticipadas y Saludos