You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by navrc <na...@seznam.cz> on 2008/03/12 08:20:47 UTC

two submit buttons on the form

Hallo,
I want to have two submit buttons (prev,next) for browse in DB on the form.
But I dnon't know how can I get in the flowscript which button the user
press.

Thanks you for the replay.

Pavel Navrkal
-- 
View this message in context: http://www.nabble.com/two-submit-buttons-on-the-form-tp15999171p15999171.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: two submit buttons on the form

Posted by Grzegorz Kossakowski <gr...@tuffmail.com>.
Tony Edwards pisze:
[...]

> I'm not sure if things have changed too much in 2.2 but using this
> method I could have a number of buttons on a form.
> 

No, they haven't change so much to break this solution. Actually, Tony's solution is the cleanest
and the best solution I would recommend myself.

-- 
Grzegorz Kossakowski

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: two submit buttons on the form

Posted by Tony Edwards <an...@optusnet.com.au>.
In 2.1.10 I was doing it like this:

My cforms file had two buttons like this:

        <fd:submit id="deleteYes" action-command="delete" validate="false">
            <fd:label>Yes</fd:label>
        </fd:submit>
        <fd:submit id="deleteNo" action-command="deleteCancel" 
validate="false">
            <fd:label>No</fd:label>
        </fd:submit>

Then in my flow I had this:

    deleteConfirm.showForm("view/deleteConfirm.cforms");
    if ("deleteYes".equals (deleteConfirm.submitId)) {
        print("YES selected! Delete!");      
        return;
    } else {   
        message="Deletion cancelled.";
        welcome();   
        return;
    }           

I'm not sure if things have changed too much in 2.2 but using this 
method I could have a number of buttons on a form.

Hope this helps,

Tony

Andre Juffer wrote:
> Pavel,
>
> you did use
>
> cocoon.request.getParameter("browse");
>
> instead of
>
> cocoon.request.getParameter();
>
> I assume?
>
> I assume. I wrote in my first response to your question that you form 
> should include something like the following;
>
> <input type="submit"  name="browse" value="browse-1" />
> <input type="submit"  name="browse" value="browse-2" />
> ----------------------^^^^
> The name attribute is what Jeroen is referring to.
> Andre
>
>
> Jeroen Reijn wrote:
>> Hi Pavel,
>>
>> are you using Cocoon Forms or just a plain HTML form? The important
>> thing while using the plain html form is that your submit buttons should
>> both have a name attribute.
>>
>> Regards,
>>
>> Jeroen
>> On Wed, 2008-03-12 at 05:24 -0700, navrc wrote:
>>> It doesn't work :-( . From function cocoon.request.getParameter() I 
>>> always
>>> obtain NULL.
>>>
>>> Pavel Navrkal
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>
>

-- 
Tony Edwards
Mob: 0411 636 761
Skype: anthony.b.edwards
email: anthonybedwards@optusnet.com.au
http://vomoir.blogspot.com/


Re: two submit buttons on the form

Posted by Andre Juffer <An...@oulu.fi>.
Pavel,

you did use

cocoon.request.getParameter("browse");

instead of

cocoon.request.getParameter();

I assume?

I assume. I wrote in my first response to your question that you form 
should include something like the following;

<input type="submit"  name="browse" value="browse-1" />
<input type="submit"  name="browse" value="browse-2" />
----------------------^^^^
The name attribute is what Jeroen is referring to.
Andre


Jeroen Reijn wrote:
> Hi Pavel,
> 
> are you using Cocoon Forms or just a plain HTML form? The important
> thing while using the plain html form is that your submit buttons should
> both have a name attribute.
> 
> Regards,
> 
> Jeroen
> On Wed, 2008-03-12 at 05:24 -0700, navrc wrote:
>> It doesn't work :-( . From function cocoon.request.getParameter() I always
>> obtain NULL.
>>
>> Pavel Navrkal
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 


-- 
Andre H. Juffer              | Phone: +358-8-553 1161
The Biocenter and            | Fax: +358-8-553-1141
     the Dep. of Biochemistry | Email: Andre.Juffer@oulu.fi
University of Oulu, Finland  | WWW: www.biochem.oulu.fi/Biocomputing/
NordProt                     | WWW: www.nordprot.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: two submit buttons on the form

Posted by Jeroen Reijn <j....@hippo.nl>.
Hi Pavel,

are you using Cocoon Forms or just a plain HTML form? The important
thing while using the plain html form is that your submit buttons should
both have a name attribute.

Regards,

Jeroen
On Wed, 2008-03-12 at 05:24 -0700, navrc wrote:
> It doesn't work :-( . From function cocoon.request.getParameter() I always
> obtain NULL.
> 
> Pavel Navrkal

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: two submit buttons on the form

Posted by navrc <na...@seznam.cz>.
It doesn't work :-( . From function cocoon.request.getParameter() I always
obtain NULL.

Pavel Navrkal
-- 
View this message in context: http://www.nabble.com/two-submit-buttons-on-the-form-tp15999171p16001974.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: two submit buttons on the form

Posted by Andre Juffer <aj...@sun3.oulu.fi>.
 > navrc wrote:
> Hallo,
> I want to have two submit buttons (prev,next) for browse in DB on the form.
> But I dnon't know how can I get in the flowscript which button the user
> press.

For instance:

In your form:

<input type="submit"  name="browse" value="browse-1" />
<input type="submit"  name="browse" value="browse-2" />

In flow:

var browse = cocoon.request.getParameter("browse");
if (browse == "browse-1")
{
...
}
else
{
....
}

> 
> Thanks you for the replay.
> 
> Pavel Navrkal


-- 
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