RE: [PHP-ES] Deshabilitar enter con submit

From: Date: Fri, 19 Apr 2002 19:23:23 +0000
Subject: RE: [PHP-ES] Deshabilitar enter con submit
References: 1  Groups: php.general.es 
Request: Send a blank email to general-es+get-21689@lists.php.net to get a copy of this message
Vik La solución esta muy bien, pero el problema que tengo es este. Tengo un script de validación que activo con: <form method=get action="sol_add.php" name="sol" onSubmit="validate();return returnVal;"> cuando uso <input type=submit.... el validador de datos trabaja muy bien, pero el formulario hace submit con ENTER cosa que quiero evitar. Luego si modifico el boton a la forma: <input type=button value="Enviar Datos" onclick=document.sol.submit()> Ya no se hace submit con presionar <ENTER>, pero el validador de datos validate() ya nose activa con el evento submit. Es decir que mi problema resulta en tener al mismo tiempo la validación por el evento submit y evitar que <ENTER> haga submit del formulario. Gracias por la ayuda me sirve tambien pero no en este caso. Saludos cordiales > -----Mensaje original----- > De: Conocimiento Virtual [mailto:conocimientovirtual@epm.net.co] > Enviado el: viernes, 19 de abril de 2002 14:56 > Para: lista@phpes.com > Asunto: RE: [PHP-ES] Deshabilitar enter con submit > > > Hubert!!! > > Claro que si se que ejecuta el onsubmit. Si tú en el botón > haces algo como > esto: > ----------------------------------- > <form name=frmPrueba...> > ... > <input type=button value="Enviar Datos" > onclick=document.frmPrueba.submit()> > </form> > ----------------------------------- > Entonces al darle click al botón es como si fuera un submit > button, pero si > le das enter, no pasa nada (a menos de que tengas el foco > sobre el botón). > > Speruabertiayudao. > > Vik! ® > > > > ----- Original Message ----- > From: Hubert Abasto <habasto@bcb.gov.bo> > To: <lista@phpes.com> > Sent: Friday, April 19, 2002 12:49 PM > Subject: RE: [PHP-ES] Deshabilitar enter con submit > > > > Saludos > > > > Esta solución esta bien ,pero en el form tengo el evento > OnSubmit para > > validar datos, resulta que cuando reemplazo submit por > button ya no se > > ejecuta el validador de datos. Hay otra forma?? > > > > gracias > > > > > -----Mensaje original----- > > > De: Ignacio Napal [mailto:inapal@equiplus.com] > > > Enviado el: viernes, 19 de abril de 2002 12:22 > > > Para: lista@phpes.com > > > Asunto: Re: [PHP-ES] Deshabilitar enter con submit > > > > > > > > > No declares el botón de tipo "Submit", sino de tipo "Button", > > > y dispara el > > > submit con el evento "onClick" del mismo. > > > > > > Ignacio. > > > > > > ----- Original Message ----- > > > From: "Hubert Abasto" <habasto@bcb.gov.bo> > > > To: <lista@phpes.com> > > > Sent: Friday, April 19, 2002 1:07 PM > > > Subject: [PHP-ES] Deshabilitar enter con submit > > > > > > > > > > Saludos a la lista. > > > > > > > > Una pregunta fácil, quiero que al llenar un formulario > > > <ENTER> no haga > > > > submit del mismo sino solo click en el boton correspondiente. > > > > > > > > Gracias > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > Archivo On-line: http://www.phpes.com/ > > > > via news: news://news.phpes.com/ > > > > Manual PHP en español: > > > > http://www.php.net/manual/es/ > > > > Para dar de baja la suscripción, mande un mensaje a: > > > > lista-unsubscribe@phpes.com > > > > > > > > > > --------------------------------------------------------------------- > > > Archivo On-line: http://www.phpes.com/ > > > via news: news://news.phpes.com/ > > > Manual PHP en español: http://www.php.net/manual/es/ > > > Para dar de baja la suscripción, mande un mensaje a: > > > lista-unsubscribe@phpes.com > > > > > > > > > > --------------------------------------------------------------------- > > Archivo On-line: http://www.phpes.com/ > > via news: news://news.phpes.com/ > > Manual PHP en español: http://www.php.net/manual/es/ > > Para dar de baja la suscripción, mande un mensaje a: > > lista-unsubscribe@phpes.com > > > > > --------------------------------------------------------------------- > Archivo On-line: http://www.phpes.com/ > via news: news://news.phpes.com/ > Manual PHP en español: http://www.php.net/manual/es/ > Para dar de baja la suscripción, mande un mensaje a: > lista-unsubscribe@phpes.com >

« previous php.general.es (#21689) next »