Código PHP:
Ver original
xmlhttp.send();
Deberían de ir las variables?
Te recuerdo el cod completo.
Código PHP:
Ver original
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]; } 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. } } } }