cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Lowe <mel...@gmail.com>
Subject Re: get an array from cocoon request
Date Thu, 17 Mar 2005 08:18:24 GMT
I'm not sure if something clever happens in cocoon but in a standard
case you'd want something like

<input type="checkbox" name="groups[0]" value="1" />

var value1 = cocoon.request.getParameter("groups[0]");

multple select would perhaps behave more as you expect, but checkbox
is typically submiting a single value, any implemention of indexed
properties is done by whoever is doing the coding. groups[0] is a
string like anyother, just that by using the index its more scriptable
and readable then an alternative technique.

You could iterate through the parameterNames to get the properties
that contain the string groups from the index of zero.

Mark


On Thu, 17 Mar 2005 10:07:05 +0200, Vlad Golodov <vlad@top.ee> wrote:
> Hi!
> 
> was trying for a while to get an array from cocoon request in a JS flow. I
> don't use CForms.
> 
> Such code is submitted:
> <input type="checkbox" name="groups[]" value="1"/> group 1
> <input type="checkbox" name="groups[]" value="2"/> Group 2
> <input type="checkbox" name="groups[]" value="3"/> Group 3
> 
> In JS I was trying to get it in ways:
> var groups = cocoon.request["groups"];
> var groups = cocoon.request.groups;
> var groups = cocoon.request.getParameter("groups");
> 
> Any ideas what could be wrong?
> 
> Thanks in advance,
> 
> Vlad
> 
> ---------------------------------------------------------------------
> 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


Mime
View raw message