Hi,

I'm new to mason2. In html::mason it was fairly easy to capture the 
values of a multi-select formfield in the receiving component. Now, when 
I post values only 1 value is received. Same problem occurs when I use a 
checkbox that can be ticket more than once.

This is my form:

<form action="query_design" method="post">
     <select name="table_classes" multiple="multiple">
         <option value="table-bordered">table-bordered</option>
         <option value="table-condensed">table-condensed</option>
         <option value="table-hover">table-hover</option>
     </select>
     <button type="submit" name="submit" value="OK">OK</button>
</form>

This is a piece of code in the receiving component 'query_design.mc', 
testing whether a list or a scalar variable is received:

% my @list;
% eval { @list = @{$.table_classes}; }; # check if list is received
% if ( !$@ ) { # It is indeed a list
%   for my $i ( @list ) {
         listvalue--><% $i %><br>
%   }
% } else { # It's a scalar
     <% $.table_classes %>
% }

Now, even when i select all 3 values in the select field 
'table_classes', only 1 value is received. So no list...

In html::mason I could grab the values as a list in this way!

Question: how to capture all the values of multiselect form fields in 
the receiving component?

Kind regards,

Wil Peters.





------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to