That's standard HTML browser behavior; when you hit enter in a text field,
is searches forward for a submit and clicks it.  You can perhaps address
this by putting an event handler on the text field itself.  I'd have to do
experimentation/research to find the correct event.


On Thu, Apr 17, 2014 at 6:02 AM, Michael Gentry <mgen...@masslight.net>wrote:

> Hi Ilya,
>
> As far as I know, this is standard browser/form behavior, regardless of the
> web framework you are using (Tapestry, PHP, etc).  You can use JavaScript
> to change the behavior or CSS to do tricky things, like move the positions
> of the submit buttons when they render so that the one you want to submit
> on Enter is first in the DOM, but can be elsewhere on the screen.
>
> mrg
>
>
>
> On Thu, Apr 17, 2014 at 8:14 AM, Ilya Obshadko <ilya.obsha...@gmail.com
> >wrote:
>
> > I have an interesting question: what happens exactly when user presses
> > Enter inside a TextField?
> >
> > Currently I see that form submit works as if it was triggered by the
> first
> > available Submit element (in order those elements appear in the form). I
> > don't think this is correct, but I don't have any idea (yet) how to
> handle
> > it otherwise.
> >
> > Any thoughts?
> >
> >
> > --
> > Ilya Obshadko
> >
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com
@hlship

Reply via email to