You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Christian Mittendorf <ch...@freenet.de> on 2006/02/15 18:07:41 UTC

Multiple Submit Buttons and "Enter"

Sorry, but this question is not really Tapestry related... I have a  
Form component with two Submit components. Each of them is bound to a  
listener method. And everything is working fine. As long as the user  
is using the mouse to trigger a submit. But as soon as the user  
presses the "Return" key in this form, the submit button appearing  
first is triggered. Is there a way to ensure, that submitting the  
Form via the "Return" key will always trigger Submit button foo?

Christian

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Multiple Submit Buttons and "Enter"

Posted by Michael Pchelnikov <mi...@gmail.com>.
You can simply ignore submit event by writing onclick event handler like
this:
<span jwcid="@Submit"
            listener="listener:doSubmit"
            value="..."
            onclick="if (event.target == this) {return true;} else {return
false;}" />

Re: Multiple Submit Buttons and "Enter"

Posted by an...@di.uoa.gr.
No. Only disabled fields are omitted when a form is submitted.
Fields with style="display:none"are submitted normally.
You can write a quick html to confirm this, if you want.

>From  Martijn Hinten <ma...@cumquat.nl>:

> I could be wrong here, but is it not so that "display:none" fields and 
> buttons never get included in the request. Ie, you cannot submit them...
> 
> Christian Mittendorf wrote:
> 
> > Thanks, that's a nice idea. I will give it a try tomorrow.
> >
> > Am 15.02.2006 um 18:25 schrieb Andreas Andreou:
> >
> >> I remember coming across this (was using Tap 3 then)
> >> You can try this:
> >> add a third submit button (before the others) that triggers
> >> the listener that you want to whenever the enter key is pressed
> >> and make it hidden (style="display:none").
> >> You can also try playing with the tabindex parameter - I cant remember
> >> which one had worked for me...
> >>
> >> Christian Mittendorf wrote:
> >>
> >>> Sorry, but this question is not really Tapestry related... I have a
> >>> Form component with two Submit components. Each of them is bound to a
> >>> listener method. And everything is working fine. As long as the user
> >>> is using the mouse to trigger a submit. But as soon as the user
> >>> presses the "Return" key in this form, the submit button appearing
> >>> first is triggered. Is there a way to ensure, that submitting the
> >>> Form via the "Return" key will always trigger Submit button foo?
> >>>
> >>> Christian
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >>> For additional commands, e-mail: tapestry-user- help@jakarta.apache.org
> >>>
> >>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
> 
> -- 
> 
> 
> *Cumquat Information Technology*
> De Dreef 19
> 3706 BR Zeist
> T +31 (0)30 - 6940490
> F +31 (0)10 - 6940499
> http://www.cumquat.nl <http://www.cumquat.nl/>
> 
> martijn.hinten@cumquat.nl <ma...@cumquat.nl>
> M +31 6 22 384 318
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


-- 



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Multiple Submit Buttons and "Enter"

Posted by Martijn Hinten <ma...@cumquat.nl>.
I could be wrong here, but is it not so that "display:none" fields and 
buttons never get included in the request. Ie, you cannot submit them...

Christian Mittendorf wrote:

> Thanks, that's a nice idea. I will give it a try tomorrow.
>
> Am 15.02.2006 um 18:25 schrieb Andreas Andreou:
>
>> I remember coming across this (was using Tap 3 then)
>> You can try this:
>> add a third submit button (before the others) that triggers
>> the listener that you want to whenever the enter key is pressed
>> and make it hidden (style="display:none").
>> You can also try playing with the tabindex parameter - I cant remember
>> which one had worked for me...
>>
>> Christian Mittendorf wrote:
>>
>>> Sorry, but this question is not really Tapestry related... I have a
>>> Form component with two Submit components. Each of them is bound to a
>>> listener method. And everything is working fine. As long as the user
>>> is using the mouse to trigger a submit. But as soon as the user
>>> presses the "Return" key in this form, the submit button appearing
>>> first is triggered. Is there a way to ensure, that submitting the
>>> Form via the "Return" key will always trigger Submit button foo?
>>>
>>> Christian
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: tapestry-user- help@jakarta.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>

-- 


*Cumquat Information Technology*
De Dreef 19
3706 BR Zeist
T +31 (0)30 - 6940490
F +31 (0)10 - 6940499
http://www.cumquat.nl <http://www.cumquat.nl/>

martijn.hinten@cumquat.nl <ma...@cumquat.nl>
M +31 6 22 384 318


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Multiple Submit Buttons and "Enter"

Posted by Christian Mittendorf <ch...@freenet.de>.
Thanks, that's a nice idea. I will give it a try tomorrow.

Am 15.02.2006 um 18:25 schrieb Andreas Andreou:

> I remember coming across this (was using Tap 3 then)
> You can try this:
> add a third submit button (before the others) that triggers
> the listener that you want to whenever the enter key is pressed
> and make it hidden (style="display:none").
> You can also try playing with the tabindex parameter - I cant remember
> which one had worked for me...
>
> Christian Mittendorf wrote:
>
>> Sorry, but this question is not really Tapestry related... I have a
>> Form component with two Submit components. Each of them is bound to a
>> listener method. And everything is working fine. As long as the user
>> is using the mouse to trigger a submit. But as soon as the user
>> presses the "Return" key in this form, the submit button appearing
>> first is triggered. Is there a way to ensure, that submitting the
>> Form via the "Return" key will always trigger Submit button foo?
>>
>> Christian
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user- 
>> help@jakarta.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Multiple Submit Buttons and "Enter"

Posted by Andreas Andreou <an...@di.uoa.gr>.
I remember coming across this (was using Tap 3 then)
You can try this:
add a third submit button (before the others) that triggers
the listener that you want to whenever the enter key is pressed
and make it hidden (style="display:none").
You can also try playing with the tabindex parameter - I cant remember
which one had worked for me...

Christian Mittendorf wrote:

> Sorry, but this question is not really Tapestry related... I have a 
> Form component with two Submit components. Each of them is bound to a 
> listener method. And everything is working fine. As long as the user 
> is using the mouse to trigger a submit. But as soon as the user 
> presses the "Return" key in this form, the submit button appearing 
> first is triggered. Is there a way to ensure, that submitting the 
> Form via the "Return" key will always trigger Submit button foo?
>
> Christian
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org