Re: O.T.: Problemas con Javascript y AJAX.

From: Date: Wed, 05 Apr 2006 14:53:54 +0000
Subject: Re: O.T.: Problemas con Javascript y AJAX.
References: 1  Groups: php.general.es 
Request: Send a blank email to general-es+get-58466@lists.php.net to get a copy of this message
El Miércoles, 5 de Abril de 2006 16:38, Esteban Osorio escribió: > Ok, este es el código... > > function grabar() > { > valida = validar(); > if (valida) > { > existeRut(); > document.getElementById('ingresar').value = 'true'; > window.document.consulta.submit(); > } > return; > } Creo que el fallo está en grabar() En el código de arriba se invoca a la función de abajo (existeRut) que creo que es la que valida... pero en ningún momento se devuelve valor ninguno que le diga a la función grabar que no haga el submit(). > > function existeRut() > { > var rut, resultExist; > rut = document.getElementById('rut').value + > document.getElementById('digver').value; Veo que al final usaste lo que te comenté en el otro correo para solucionar lo del firefox ;-) > ajax = nuevoAjax(); > ajax.open("GET", "procesos2.php?rut="+rut, true); > ajax.onreadystatechange=function() { > if (ajax.readyState == 4) { > resultExist = ajax.responseText; > if(resultExist!="N") { > document.getElementById('id_usuario').value > = resultExist; > if(confirm("¡El RUT ingresado se ha > registrado anteriormente en el sistema!.\n\n Haga clic en ACEPTAR para > modificar los datos o CANCELAR para mantener los anteriores.")) > { > > document.getElementById('modificado').value = 'true'; > > document.getElementById('buscado').value = 'true'; > } else { > > document.getElementById('mantenerDatos').value = 'true'; > } > return; > } > } > } > ajax.send(null); > return; > } > Un saludo. -- ---- Pablo C. Vergara Castro. Departamento de informática. TQR-Software Tlfno.: (+34) 986 39 31 49 Fax: (+34) 986 31 25 96 La información transmitida va dirigida únicamente a la persona o entidad que se muestra como destinatario y puede contener datos confidenciales o privilegiados. Toda revisión, retransmisión, diseminación u otro uso o acción al respecto por parte de personas o entidades distintas al destinatario está prohibida. Si recibe esto por error, por favor contacte con la persona que figura como remitente y elimine el material de cualquier ordenador. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any Computer.

« previous php.general.es (#58466) next »