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 :)