Ver Mensaje Individual
  #2 (permalink)  
Antiguo 17/11/2011, 07:23
Avatar de linuxzero
linuxzero
 
Fecha de Ingreso: noviembre-2011
Ubicación: Argentina
Mensajes: 778
Antigüedad: 12 años, 5 meses
Puntos: 160
Respuesta: Varios formularios enviar con enter solo el completo

Aca te dejo un ejemplo en jQuery, si no te sirve avisame.

Código Javascript:
Ver original
  1. $(document).keydown(function(e) {
  2.       if (e.keyCode == 13) {
  3.             //alert("enter");
  4.             $('.form').each(function(i) {
  5.                   if ($(this).find("input").val().length > 0) {
  6.                        $(this).submit();
  7.                   }
  8.             });
  9.       }
  10. });


Fijate de ponerle a cada tag del form en el html, el class "form", entonces deberian quedar asi:

Código HTML:
Ver original
  1. <form class="form" action="pagina1.php" method="POST" >
  2. <form class="form" action="pagina2.php" method="POST" >
  3. <form class="form" action="pagina3.php" method="POST" >

Avisame cualquier cosa.

Saludos!
__________________
Si todo fuera tan sencillo como un symfony cc la vida seria más fácil.
http://phpnico.wordpress.com