I have many situations like this in my application. This is what I have
done. Have a hidden field at the top of the form as 'btnpressed' and on
onclick event of each of the buttons, set a unique value to the hidden field
("this.form.btnpressed.value='value1'"). In your action, check the value of
th
Wendy Smoak wrote:
From: "Laurie Harper" <[EMAIL PROTECTED]>
By 'hidden button' do you mean a regular input w/ type=submit and CSS to
hide it?
Yes. :) In my case, defaulting to the first button on the form didn't make
sense, so that invisible button does nothing. The form is submitted and
Is that a type="button" or type="submit"? Just to clarify, because return
only affects submits I believe.
Also, I'm pretty sure if you do:
onClick="return false;"
...attached to that invisible button, you wouldn't even get the redisplay
submission.
--
Frank W. Zammetti
Founder and Chief Softw
From: "Laurie Harper" <[EMAIL PROTECTED]>
> By 'hidden button' do you mean a regular input w/ type=submit and CSS to
> hide it?
Yes. :) In my case, defaulting to the first button on the form didn't make
sense, so that invisible button does nothing. The form is submitted and
re-displayed as-is.
Wendy Smoak wrote:
You may also want to add a "hidden" button at the very top of the form, with
a value that causes your app to simply redisplay the form.
At least on IE, pressing enter in a text field will submit the form without
the user pressing _any_ of the buttons. But IE will send the val
On 7/26/05, Thomas Sundberg <[EMAIL PROTECTED]> wrote:
> Hi!
>
> I have a form where a user should be able to request a report. The user
> enters two dates and then presses either a button labeled pdf, html och csv.
> How can I read in my action which button was pressed?
DispatchAction and all it
ionIs";
document.formName.submit();
Just a thought..
Martin-
- Original Message -
From: "Wendy Smoak" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List"
Sent: Tuesday, July 26, 2005 11:27 AM
Subject: Re: Which button was pressed?
From: "Braun, James F"
Paul Moody wrote:
I think you will need to use the property attribute,
example:
You can put a String docType property in your form and
examine it in the action to see what the user pressed.
As an aside, in my experience this becomes a bit more
complicated in a multilingual application where
ss you just need to
check for the existence of the parameter (i.e. not null) to determine
which button was pressed. The value is not important in this case.
HTH,
- Scott
> -Original Message-
> From: Braun, James F [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 26, 2005 11:18
From: "Braun, James F" <[EMAIL PROTECTED]>
> The value of the button pressed
> will be stored in the bean's submit variable (which you must create).
> The bean:message tag is there so that the button's title will be set
> according to the locale setting. app.submit, app.renew, and app.replace
> re
Finally a question I can answer!
Below is my code to do what you want. The value of the button pressed
will be stored in the bean's submit variable (which you must create).
The bean:message tag is there so that the button's title will be set
according to the locale setting. app.submit, app.renew,
I think you will need to use the property attribute,
example:
You can put a String docType property in your form and
examine it in the action to see what the user pressed.
As an aside, in my experience this becomes a bit more
complicated in a multilingual application where the
value of the butt
12 matches
Mail list logo