[development] Form API and enter key press

Pierre Rineau. pierre.rineau at makina-corpus.com
Wed Mar 3 10:11:47 UTC 2010


Hi all!

I experience a simple problem, which a lot of people must have
experienced too.

I have a lot of forms with multiple submit actions, my problem here is
when a user press the enter key, it does submit the form, but using the
first found action (in form API elements order).

My problem here is because a multistep form ergonomic style would tell
you to put <prev action> then <next action>, but when pressing enter,
the <prev action> is the first submit button found so the browser will
submit this one.

I experience the same problem in other use case than multistep form. Is
there a clean way (without too many JS) to force the default submit
action on enter key press?

Regards,

-- 
Pierre (pounard) R.
Courriel -- Jabber/XMPP(/GTalk): pounard at processus.org



More information about the development mailing list