Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/09/2008, 04:07
cybersersupremo
 
Fecha de Ingreso: marzo-2004
Ubicación: España
Mensajes: 185
Antigüedad: 20 años, 1 mes
Puntos: 19
jquery submit

Hola, estoy intentando con jquery enviar un formulario y si tiene algo mal que me lo ponga en un div el error. Pero el problema es que cuando pulso el submit hace lo que hace el ajax y luego hace como le submit normal y se va a la url del action. yo no quiero que se vaya al url del action simplemente quiero que lo haga con ajax. no se que puedo estar haciendo mal.

Por ejemplo os pongo este ejemplo: Quiero que cuando pulse el submit me haga el alert y nada mas:

Código:
<html>
<head>
	<title>Formulario dinamico</title>
<script src="jquery/jquery.js" type="text/javascript"></script>
<script type="text/javascript">

            $(document).ready(function (){
			//alert("READY");
			   $("#formid").submit( function (){	
			   	alert("SUBMIT");	   

				});
            });
</script>

</head>
<body>

<form id="formid" method="post" action="procesaajax.php"><br/>
Nombre * <input type="text" name="nombre" /><br/>
Email * <input type="text" name="email" /><br/>
Empresa <input type="text" name="empresa" /><br/>
Teléfono * <input type="text" name="telefono" /><br/>
Fax <input type="text" name="fax" /><br/>
Web <input type="text" name="web" /><br/>

<input type="submit" value="Enviar"/>
</form> 
<div id="resultados"></div>


</body>
</html>
__________________
Escape Room -

Ios Games