[development] Form API and enter key press
Randy Fay
randy at randyfay.com
Mon Mar 8 16:06:10 UTC 2010
Does this work with Chrome? It seems like I've seen Chrome refuse to use the
enter key when there is more than one submit on the page.
-Randy
On Mon, Mar 8, 2010 at 1:55 AM, Pierre Rineau. <
pierre.rineau at makina-corpus.com> wrote:
> On Wed, 2010-03-03 at 14:55 -0500, Andrew Berry wrote:
> > On 2010-03-03, at 6:01 AM, Pierre Rineau. wrote:
> >
> > > Found my own solution, a jQuery based script that searchs for a
> specific
> > > class on form input elements and trick the browser by preprending a
> > > cloned version of the default submit button on top of the form.
> >
> > When I've dealt with this in the past, I've caught the input event and
> fired the appropriate action. How does that compare to your solution?
> >
> > --Andrew
>
> I read some posts saying that catching the enter key can be hard to do
> with some browsers. I finally choose another solution: copying the
> default button DOM element on top of the form, but hidden in order to be
> fully transparent for the end user. It seemed to be the nicest solution
> because it does not requires your javascript to add any events on
> buttons and it let the browser do its job.
>
> See http://drupal.org/project/default_submit
>
> Regards,
> Pierre.
>
>
>
>
--
Randy Fay
Drupal Development, troubleshooting, and debugging
randy at randyfay.com
+1 970.462.7450
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20100308/679e0f76/attachment.html
More information about the development
mailing list