Ver Mensaje Individual
  #31 (permalink)  
Antiguo 02/12/2012, 18:11
Avatar de satjaen
satjaen
 
Fecha de Ingreso: septiembre-2012
Ubicación: Jaén (Andalucía)
Mensajes: 893
Antigüedad: 12 años, 5 meses
Puntos: 10
Respuesta: No me lleva a la pagina.

@jmdearpe, he estado revisando el código y me parece que aquí:
Código PHP:
Ver original
  1. xmlhttp.send();

Deberían de ir las variables?
Te recuerdo el cod completo.

Código PHP:
Ver original
  1. function GuardaFormulario()
  2. {
  3.     var _TELEFONO = document.forms['form1'].elements['TELEFONO'];
  4.     if (_TELEFONO.value.length == 0)
  5.     {
  6.  
  7.         alert("Insertar el Teléfono");
  8.  
  9.         _TELEFONO.focus();
  10.  
  11.         return 0;
  12.  
  13.     }
  14.     else
  15.     {
  16.         if (window.XMLHttpRequest)
  17.         {
  18.             xmlhttp=new XMLHttpRequest();
  19.         }
  20.         else
  21.         {
  22.             xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  23.         }
  24.        
  25.         xmlhttp.open("GET", "valida1.php?TELEFONO=" + _TELEFONO, true);
  26.         xmlhttp.send();
  27.         if (xmlhttp.readyState==4 && xmlhttp.status==200)      
  28.        
  29.         {
  30.             var xml = xmlhttp.responseXML;
  31.             dato=xml.getElementsByTagName("datos");
  32.             if(dato[0].firstChild.nodeValue=="1")
  33.             {
  34.                 num_user=xml.getElementsByTagName("numusuario");
  35.                 var boton = confirm("¡Usuario existente!¿Desea hacer un nuevo registro?"); 
  36.                 if (boton)
  37.                 {
  38.                     window.location.href = "menu3.php?id="+num_user[0];
  39.                 }
  40.                 else
  41.                 {  
  42.                     window.location.href = "menu4.php";  
  43.                 }
  44.             }
  45.             if(dato[0].firstChild.nodeValue=="0")
  46.             {                
  47.                 alert("¡El Cliente se ha dado de alta!");    
  48.                 document.forms['form1'].submit();////Aquí mando el formulario si el teléfono no existe.
  49.             }
  50.         }
  51.     }
  52. }