You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Mark Lybarger <Ma...@CBC-Companies.com> on 2003/09/08 13:56:51 UTC

Action events - default submit button

I have a form with 3 submit buttons.  When I press enter on the form, it
seems the browser (ie and mozilla) pretends that I've clicked on the first
submit button that appears in the html. Unfortunately, this is not the
default button that I'd like to have.

How can i make a default submit default button other than what the browser
considers to be the default (first coded)?  

Thanks!
Mark

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.509 / Virus Database: 306 - Release Date: 8/12/2003
 


Re: Action events - default submit button

Posted by Samuel Le Berrigaud <le...@essi.fr>.
this html input will call the method doUpload of the associated action 
file referenced by the form

<form method=post action=$link.setAction("Upload") >
<input type="submit" name="eventSubmit_doUpload" value="upload" />
</form>

becarefull no Uppercase letter is accepted after the first one ...

Hope it helps...

SaM

Peter Courcoux wrote:

>Mark,
>
>If you are using T2.3 I think you can use a value attribute to the
><input> tag to indicate which event to action. I have not used this
>feature yet but I believe that the technique is to use javascript to set
>the value attribute of the <input> element corresponding to the button
>which is being clicked. There is a property in TR.props :-
>
>action.eventsubmit.needsvalue = false
>
>which switches this feature on. If true, the code in ActionEvent selects
>the method corresponding to the element with the value attribute set. If
>false, the default, it selects the first eventSubmit_doXXX method it
>finds. 
>
>You can, of course, set the value for the default button, and use the
>javascript to change it if another button is clicked.
>
>I think that there are some docs about this somewhere, but it is a
>recent addition to the 2.3 code.
>
>I hope this helps.
>
>Regards,
>
>Peter
>
>On Mon, 2003-09-08 at 12:56, Mark Lybarger wrote:
>  
>
>>I have a form with 3 submit buttons.  When I press enter on the form, it
>>seems the browser (ie and mozilla) pretends that I've clicked on the first
>>submit button that appears in the html. Unfortunately, this is not the
>>default button that I'd like to have.
>>
>>How can i make a default submit default button other than what the browser
>>considers to be the default (first coded)?  
>>
>>Thanks!
>>Mark
>>
>>---
>>Outgoing mail is certified Virus Free.
>>Checked by AVG anti-virus system (http://www.grisoft.com).
>>Version: 6.0.509 / Virus Database: 306 - Release Date: 8/12/2003
>> 
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>>    
>>


Re: Action events - default submit button

Posted by Peter Courcoux <pe...@courcoux.biz>.
Mark,

If you are using T2.3 I think you can use a value attribute to the
<input> tag to indicate which event to action. I have not used this
feature yet but I believe that the technique is to use javascript to set
the value attribute of the <input> element corresponding to the button
which is being clicked. There is a property in TR.props :-

action.eventsubmit.needsvalue = false

which switches this feature on. If true, the code in ActionEvent selects
the method corresponding to the element with the value attribute set. If
false, the default, it selects the first eventSubmit_doXXX method it
finds. 

You can, of course, set the value for the default button, and use the
javascript to change it if another button is clicked.

I think that there are some docs about this somewhere, but it is a
recent addition to the 2.3 code.

I hope this helps.

Regards,

Peter

On Mon, 2003-09-08 at 12:56, Mark Lybarger wrote:
> I have a form with 3 submit buttons.  When I press enter on the form, it
> seems the browser (ie and mozilla) pretends that I've clicked on the first
> submit button that appears in the html. Unfortunately, this is not the
> default button that I'd like to have.
> 
> How can i make a default submit default button other than what the browser
> considers to be the default (first coded)?  
> 
> Thanks!
> Mark
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.509 / Virus Database: 306 - Release Date: 8/12/2003
>  
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
-- 
Peter Courcoux <pe...@courcoux.biz>

AW: Action events - default submit button

Posted by Jürgen Hoffmann <jh...@byteaction.de>.
Just put a hidden field with the default Value and name and this should
work.

<input type="submit" name="eventSubmit_doMethod1" value="do 1">
<input type="submit" name="eventSubmit_doMethod2" value="do 2">
<input type="submit" name="eventSubmit_doMethod3" value="do 3">
<input type="hidden" name="eventSubmit_doMethod2" value="do 2">

Kind regards
 
Jürgen Hoffmann
ByteACTION GmbH
 

-----Ursprüngliche Nachricht-----
Von: Mark Lybarger [mailto:Mark.Lybarger@CBC-Companies.com] 
Gesendet: Montag, 8. September 2003 13:57
An: 'Turbine Users List' (E-mail)
Betreff: Action events - default submit button


I have a form with 3 submit buttons.  When I press enter on the form, it
seems the browser (ie and mozilla) pretends that I've clicked on the
first submit button that appears in the html. Unfortunately, this is not
the default button that I'd like to have.

How can i make a default submit default button other than what the
browser considers to be the default (first coded)?  

Thanks!
Mark

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.509 / Virus Database: 306 - Release Date: 8/12/2003
 


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