Ver Mensaje Individual
  #39 (permalink)  
Antiguo 03/12/2012, 17:30
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.

SOLUCIONADO.
He puesto parte del anterior código.
Código Javascript:
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.         xmlhttp.open("GET", "valida1.php?TELEFONO=" + TELEFONO.value, false);
  25.         xmlhttp.send();    
  26.  
  27.         if (xmlhttp.readyState==4 && xmlhttp.status==200)      
  28.         {
  29.             var xml = xmlhttp.responseXML;
  30.             dato=xml.getElementsByTagName("datos");
  31.             if(dato[0].firstChild.nodeValue=="1")
  32.             {
  33.                 num_user=xml.getElementsByTagName("numusuario");
  34.                
  35.                 if (confirm("¡Usuario existente!¿Desea hacer un nuevo registro?"))
  36.                 {
  37.                    window.location.href = "menu3.php?id="+num_user[0].firstChild.nodeValue;    
  38.                 }
  39.                 else
  40.                 {
  41.                     window.location.href = "menu4.php";  
  42.                 }
  43.             }
  44.             if(dato[0].firstChild.nodeValue=="0")
  45.             {                  
  46.                                 alert("¡El Cliente se ha dado de alta!");
  47.                 document.forms['form1'].submit();////Aquí mando el formulario si el teléfono no existe.
  48.             }
  49.         }
  50.  
  51.     }
  52. }

Muchas gracias.