struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank Zammetti" <fzamm...@hotmail.com>
Subject RE: More than one submit buttons
Date Tue, 01 Jun 2004 16:22:40 GMT
I've never tried this, but I've done the reverse, so it probably should 
work... you should be able to just eat the enter key event via client-side 
scripting.  This SHOULD work:

if (window.event.keyCode == 13) { return false; }

Attach that as a page-level event handler and I think it'll do the trick.  
You may have to attach it to each of the submit buttons (in fact, that might 
be required INSTEAD of making it page-level, I think that might be the 
case).

As I said, I've done the exact reverse, handling enter as a submit event (so 
that you could submit the form when any of the fields has focus rather than 
just the submit button), so I'd bet this works.

>From: "Kamholz, Keith   (corp-staff) USX" <kkamholz@moog.com>
>Reply-To: "Struts Users Mailing List" <user@struts.apache.org>
>To: 'Struts Users Mailing List' <user@struts.apache.org>
>Subject: RE: More than one submit buttons
>Date: Tue, 1 Jun 2004 11:48:48 -0400
>
>I have a similar but different problem.  I'm using multiple submit buttons
>on a form, using the Lookup Dispatch Action.  Are you using that too?
>Anyway, when I click on a button, it works just fine.  However, when the
>enter button is pressed, I get an error.  It probably doesn't know which
>method to use since I didn't actually a button.  How do you (or anyone 
>else)
>deal with this issue?
>
>
>- Keith
>
>
>
>-----Original Message-----
>From: Voinea, Marina [mailto:Marina.Voinea@genesys.com]
>Sent: Monday, May 31, 2004 11:49 AM
>To: Struts Users Mailing List
>Subject: RE: More than one submit buttons
>
>
>Regariding the same issue : multiple submit buttons on a form :
>   We've implemented this succsefully, however, there is still an issue ,
>does anybody have an idea what would be the best and simplest way to deal
>with it?
>
>
>   The problem is as following :
>     A form gets submitted not only through a submit button, but also by
>entering "CR" (enter, carriage return...).
>    The thing is that, in that case, the first button on the form seems to
>get submitted, and  I get , in my request , the parameter associated with
>the first button on the form, which is wrong.
>   (The action checks for that parameter and finds that the button has been
>submitted, which is wrong....).
>    I would like to stop the form from being submitted on "enter" for ex...
>
>   What would be the best way to solve this issue? How do you guys usually 
>do
>it (and still using STruts multiple buttons on the same form...)
>
>Thank you very mch.....
>Marina
>
>
>-----Original Message-----
>From: praveen kulkarni [mailto:job4pak@yahoo.co.in]
>Sent: Monday, May 31, 2004 1:28 AM
>To: user@struts.apache.org
>Subject: Re:More than one submit buttons
>
>
>Hi Kalla,
>
>To use more than one submit buttons, in struts, u can use
>DispatchAction which is a subclass of Action.
>
>By configuring the action in Struts-config, u can add "parameter"
>attribute as "submit".
>
>And no need of writing n number of Action classes for n submit
>buttons!!!
>
>u can write it as buttonAAction(......) instead of execute(...) func
>
>Bye
>PAK
>
>Yahoo! India Matrimony: Find your partner online.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>

_________________________________________________________________
Get 200+ ad-free, high-fidelity stations and LIVE Major League Baseball 
Gameday Audio! http://radio.msn.click-url.com/go/onm00200491ave/direct/01/


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


Mime
View raw message