RE: Which button was pressed?

2005-07-26 Thread Vijaya S
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

Re: Which button was pressed?

2005-07-26 Thread Laurie Harper
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

Re: Which button was pressed?

2005-07-26 Thread Frank W. Zammetti
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

Re: Which button was pressed?

2005-07-26 Thread Wendy Smoak
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.

Re: Which button was pressed?

2005-07-26 Thread Laurie Harper
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

Re: Which button was pressed?

2005-07-26 Thread Michael Jouravlev
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

Re: Which button was pressed?

2005-07-26 Thread Martin Gainty
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"

Re: Which button was pressed?

2005-07-26 Thread Tamas Szabo
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

RE: Which button was pressed?

2005-07-26 Thread Scott Piker
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

Re: Which button was pressed?

2005-07-26 Thread Wendy Smoak
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

RE: Which button was pressed?

2005-07-26 Thread Braun, James F
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,

Re: Which button was pressed?

2005-07-26 Thread Paul Moody
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