En la funcion que me pones no faltan llaves {}????

[js]
if (existe.indexOf("Encontrado", 0) > 0)
alert(telefono + " ya se encuentra registrado");
else
alert(telefono + " no ha sido registrado");
[/js]
Un saludo
Posted 24 October 2012 - 08:56 AM
Posted 24 October 2012 - 09:04 AM
En la funcion que me pones no faltan llaves {}????
[js]
if (existe.indexOf("Encontrado", 0) == 0)
alert(telefono + " ya se encuentra registrado");
else
alert(telefono + " no ha sido registrado");
[/js]
Un saludo
Posted 24 October 2012 - 09:12 AM
Posted 24 October 2012 - 09:18 AM
Ok, y entonces porque no me sigue despues de aquí:
function GuardaFormulario() {
//usemos mejor las CoLECCIONES, y variables, así ahorramos codigo y lo hace fácil de mantener
var _telefono = document.forms['form1'].elements['telefono'];
if (_telefono.value.length == 0){
alert("Insertar el Teléfono");
_telefono.focus();
return 0;
}
////Hasta aquí bien pero luego ya no hace nada?///////
else {
var existe = TelefonoExiste(telefono);
if (existe.indexOf("Encontrado", 0) > 0)
alert(telefono + " ya se encuentra registrado");
else
alert(telefono + " no ha sido registrado");
return 0;
}
}
Posted 24 October 2012 - 09:35 AM
Posted 24 October 2012 - 09:44 AM
Posted 24 October 2012 - 10:25 AM
Posted 24 October 2012 - 11:15 AM
Posted 24 October 2012 - 03:22 PM
<?php
require_once('Connections/conexion.php');
$telefono = isset($_GET['telefono']) ? $_GET['telefono']:"";
$query=("SELECT telefono FROM usuarios WHERE telefono ='".$telefono."'");
$result = mysql_query($query);
$rows = mysql_num_rows($result);
if ($rows) {
echo '1';
}
?>
Posted 24 October 2012 - 06:40 PM
SOLUCIONADO
Muchas gracias, Poliburro por tu ayuda los codigos quedarían así: