Ver Mensaje Individual
  #23 (permalink)  
Antiguo 30/11/2012, 11:46
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.

Cita:
Iniciado por jmdearpe Ver Mensaje
Vale eso ya es más coherente, el problema es que tu usabas una llamada desde AJAX un poco distitnta y al pegar el código de la llamada de tu anterior javadcript no me di cuenta que estabas usando la función encodeURIComponent, pero en realidad aqui no hace falta, simplemente eliminandola debería de ir...

Código HTML:
function GuardaFormulario()
{
	var _TELEFONO = document.forms['form1'].elements['TELEFONO'];
	if (_TELEFONO.value.length == 0)
	{

		alert("Insertar el Teléfono");

		_TELEFONO.focus();

		return 0;

	}
	else
	{
		if (window.XMLHttpRequest)
		{
			xmlhttp=new XMLHttpRequest();
		}
		else
		{
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		
		xmlhttp.open("GET", "valida1.php?TELEFONO=" + _TELEFONO, true);
		xmlhttp.send();	
		if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
			var xml = xmlhttp.responseXML;
			dato=xml.getElementsByTagName("datos");
			if(dato[0].firstChild.nodeValue=="1")
			{
				num_user=xml.getElementsByTagName("numusuario");
				var boton = confirm("¡Usuario existente!¿Desea hacer un nuevo registro?");	
				if (boton)
				{ 
					window.location.href = "menu3.php?id="+num_user[0];/////Aquí es donde no sé traer esta variable/////  
				} 
				else 
				{  
					window.location.href = "menu4.php";	  
				}
			}
			if(dato[0].firstChild.nodeValue=="0")
			{  				 
				alert("¡El Cliente se ha dado de alta!");	  
				document.forms['form1'].submit();////Aquí mando el formulario si el teléfono no existe.
			} 
		}
	}
}
A ver si ahora :)
Hola, sigue igual ahora la respuesta de la variable es:

GET http://localhost:8888/sitiopruebas/v....php?TELEFONO=[object%20HTMLInputElement]

200 OK
3ms