Ver Mensaje Individual
  #1 (permalink)  
Antiguo 01/02/2010, 21:29
juaann
 
Fecha de Ingreso: enero-2009
Mensajes: 77
Antigüedad: 15 años, 4 meses
Puntos: 0
Problema al enviar form

El problema es el siguiente
tengo un fomulario el cual envio sus datos por la funcion $.ajax cuando hago click en el boton la funcion anda perfecto, el boton es de tipo button, el problema es cuando aprieto enter me manda a la pagina php y se "saltea" la funcion $.ajax


Código:
  var n=$("#nick").attr("value");
  var p=$("#pass").attr("value");


  $.ajax({
           async:true,
           type: "POST",
           dataType: "html",
           contentType: "application/x-www-form-urlencoded",
           url:"autentificar.php",
           data: "nick=" + n +"&pass="+ p,
           beforeSend:inicioEnvioLog,
           success:llegadaDatosLog,
           timeout:1000,
           error:problemasLog
                        });
  
  return false;
}

function inicioEnvioLog()
{
  var x=$("#resultados");
  x.html('<img src="imagenes/cargando.gif">');
}

function llegadaDatosLog(datos)
{
	if (datos == "si")
	{
	location.reload();
	}
 else {
  var x;
  x=$(".log_input");
  x.css("border","1px solid #ff0000");

}
}

function problemasLog()
{
...
}