Ver Mensaje Individual
  #11 (permalink)  
Antiguo 07/07/2010, 09:04
Avatar de after
after
 
Fecha de Ingreso: junio-2006
Ubicación: De marte
Mensajes: 791
Antigüedad: 17 años, 11 meses
Puntos: 10
Respuesta: envio de datos formulario a php con jquery

Cita:
Iniciado por Dany_s Ver Mensaje
formo el query string con los input que tienen clase "serializar", el input apellido no lo tiene


Código Javascript:
Ver original
  1. <head>
  2. <title>Prueba</title>
  3. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
  4. <script>
  5. $(function(){
  6.     $('#ver').click( function (){
  7.         alert( $(".serializar").serialize() );
  8.     });
  9. });
  10. </script>
  11. </head>
  12. <body>
  13.     Nombre <input type="text" class="serializar" name="nombre" value="" />
  14.     Apellido <input type="text" name="apellido" value="" /><br />
  15.     M: <input type="radio" class="serializar" name="sexo" value="M"> F:<input type="radio" class="serializar" name="sexo" value="F"><br />
  16.  
  17.     <a href="#" id="ver">ver</a>
  18. </body>
  19. </html>

Código Javascript:
Ver original
  1. $('#post').live('click', function(){
  2.            
  3. $.ajax({
  4.     type: 'POST',
  5.    data: $(".serializar").serialize(),
  6.     url: 'receptor.php',
  7.    
  8.    
  9.    
  10. });
Perfecto!
Gracias por tu ayuda.!
__________________
@ivancamiloGo