Hi Peter,

I thought the point of using actions in this way was to avoid using an if
statement.  But I agree that way would work.

I don't think I need to use javascript.  I have a hidden field that contains
the name of the default button (so it gets passed when I hit enter) and if
they click on another button the name/value gets passed before the hidden
field's name/value gets passed.  The danger is if the hidden field
name/value ever gets passed before the button name/value, it would look like
I clicked on a different button than I did.  I'm wondering if this situation
would ever happen (it didn't on my sample size of 1 form but that doesn't
make me feel much better).

Thanks again,

David

-----Original Message-----
From: Peter Courcoux [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 26, 2004 12:23 PM
To: Turbine Users List
Subject: RE: Form submittal problem


David,

Another way to handle form submission is to have a separate action for
each form, handle everything in the doPerform() method and test for
which button is clicked by seeing if the parameters contain the name of
the button. 

This avoids the alternative of using javascript to set values of hidden
fields.

Peter

On Fri, 2004-03-26 at 20:13, David Demner wrote:
> Ah!  Worked great.
> 
> Will this work if there is multiple submit buttons on a form (ie:
> update/delete)?  It worked for both buttons in my sample size of 1 form,
but
> will it work in general?  I'm concerned because both the hidden field and
> submit button name get passed; the button name is first, but I want to
make
> sure the hidden field will never appears first.
> 
> Thanks again,
> 
> David
> 
> -----Original Message-----
> From: Jürgen Hoffmann [mailto:[EMAIL PROTECTED] 
> Sent: Friday, March 26, 2004 10:51 AM
> To: 'Turbine Users List'
> Subject: AW: Form submittal problem
> 
> 
> Hi,
> 
> just put a hidden field into the form. <input type="hidden"
> name="eventSubmit_doWhatever" value="1"/>
> 
> kind regards
> 
> Jürgen Hoffmann
> 
> -----Ursprüngliche Nachricht-----
> Von: David Demner [mailto:[EMAIL PROTECTED] 
> Gesendet: Freitag, 26. März 2004 19:45
> An: [EMAIL PROTECTED]
> Betreff: Form submittal problem
> 
> I'm trying to get around a form submittal problem.  I have a very simple
> form (1 text box and 1 submit button named eventsubmit_doWhatever) where
> method="post" and action="$link.setAction("MyAction")".
>  
> When the user clicks on the button, the submit button's name is passed
with
> the form data and everything works fine.  When the user hits enter the
> button in the form, the submit button's name doesn't get passed and the
> doPerform event gets called instead.  This effectively breaks the form
when
> the enter key is pressed.
>  
> How do other people handle this problem??
>  
> Thanks,
>  
> David
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to