Ver Mensaje Individual
  #3 (permalink)  
Antiguo 29/09/2010, 15:52
jiten
 
Fecha de Ingreso: febrero-2008
Mensajes: 409
Antigüedad: 17 años, 1 mes
Puntos: 2
Pregunta Respuesta: Multiple botones de envio "submit" en un formulario ?

Cita:
Iniciado por masterojitos Ver Mensaje
en el formulario no declares el action... y en cada boton llama a una diferente funcion y en esta recien asignas con javascript el action del formulario y le das submit ^^

Ejemplo rapido:
Código HTML:
Ver original
  1. <form id="frm" action="" method="get">
  2.   Buscar: <input name="q" type="text" >
  3.   <input type="button" value="Google"
  4.    onclick="this.form.action='http://www.google.com/search';this.form.submit();" />
  5.   <input type="button" value="Altavista"
  6.    onclick="this.form.action='http://altavista.com/web/results';this.form.submit();" />
  7. </form>

Suerte
Ok muchas gracias ! pero y cómo hago si quiero, antes de enviar el post al nuevo URL, chequear algunos valores de variables en JScript ?