You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jeff Schmitz <je...@mac.com> on 2008/09/24 19:38:57 UTC
flowscript and multiple submit button
Hello,
In a flowscript function, what is the best way to figure which
button made a submit on a multiple submit form? Can you get at that
information via the cocoon.request object?
Thanks,
Jeff
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: flowscript and multiple submit button
Posted by Jason Johnston <jj...@apache.org>.
Jeff Schmitz wrote:
> I was close, but I was actually using button tags, e.g.
>
> <button type="submit" name="ManageUsers" id="ManageUsers" value="Manage
> User Accounts">Manage User Accounts</button>
>
> but I wasn't setting the value attribute since what shows on the button
> is whatever is between the tags. By adding the value attribute it now
> works.
Beware that Internet Explorer has a very buggy implementation of the
button element. When the form is submitted, it sends the name=value
pairs of *all* button elements in the form, rather than just the one
that was clicked. This is a real pain when trying, as you are, to
determine which button was used to submit the form. Also, depending on
the version of IE and whether your document triggers standards or quirks
mode, the innerText of the element may be used rather than the value
attribute.
See the community comments at
http://msdn.microsoft.com/en-us/library/ms535211(VS.85).aspx or search
around for "ie button" and the like.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: flowscript and multiple submit button
Posted by Jeff Schmitz <je...@mac.com>.
I was close, but I was actually using button tags, e.g.
<button type="submit" name="ManageUsers" id="ManageUsers"
value="Manage User Accounts">Manage User Accounts</button>
but I wasn't setting the value attribute since what shows on the
button is whatever is between the tags. By adding the value attribute
it now works.
Thanks,
Jeff
On Sep 24, 2008, at 12:53 PM, Andre Juffer wrote:
> Jeff Schmitz wrote:
>> Hello,
>> In a flowscript function, what is the best way to figure which
>> button made a submit on a multiple submit form? Can you get at
>> that information via the cocoon.request object?
>
> Your form (standard HTML):
>
> <input type="submit" value="Save" name="edit" />
> <input type="submit" value="Update" name="edit" />
> <input type="submit" value="Done" name="edit" />
> <input type="reset" />
>
> In flowscript:
> var edit = cocoon.request.getParameter("edit");
> if (edit == "Save")
> {
> do_something();
> }
> else if (edit == "Update")
> {
> do_something_else();
> }
> else
> {
> do_another_thing();
> }
>
>> Thanks,
>> Jeff
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
> --
> Andre H. Juffer | Email: Andre.Juffer@oulu.fi
> The Biocenter and | WWW: www.biochem.oulu.fi/Biocomputing/
> the Dep. of Biochemistry | Fax: +358-8-553-1141
> University of Oulu, Finland | Phone: +358-8-553 1161
> Triacle Biocomputing | WWW: www.triacle-bc.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
Re: flowscript and multiple submit button
Posted by Andre Juffer <aj...@sun3.oulu.fi>.
Jeff Schmitz wrote:
> Hello,
> In a flowscript function, what is the best way to figure which button
> made a submit on a multiple submit form? Can you get at that
> information via the cocoon.request object?
Your form (standard HTML):
<input type="submit" value="Save" name="edit" />
<input type="submit" value="Update" name="edit" />
<input type="submit" value="Done" name="edit" />
<input type="reset" />
In flowscript:
var edit = cocoon.request.getParameter("edit");
if (edit == "Save")
{
do_something();
}
else if (edit == "Update")
{
do_something_else();
}
else
{
do_another_thing();
}
>
> Thanks,
> Jeff
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
--
Andre H. Juffer | Email: Andre.Juffer@oulu.fi
The Biocenter and | WWW: www.biochem.oulu.fi/Biocomputing/
the Dep. of Biochemistry | Fax: +358-8-553-1141
University of Oulu, Finland | Phone: +358-8-553 1161
Triacle Biocomputing | WWW: www.triacle-bc.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
RE: flowscript and multiple submit button
Posted by Gary Larsen <ga...@envisn.com>.
Hi Jeff,
I use something like this:
form.showForm("form/myform");
if (null == form.submitId || form.submitId.equals("cancelButton")) {
gary
> -----Original Message-----
> From: Jeff Schmitz [mailto:jeffandmonica@mac.com]
> Sent: Wednesday, September 24, 2008 1:39 PM
> To: users@cocoon.apache.org
> Subject: flowscript and multiple submit button
>
> Hello,
> In a flowscript function, what is the best way to figure which
> button made a submit on a multiple submit form? Can you get at that
> information via the cocoon.request object?
>
> Thanks,
> Jeff
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org