PetaMem has asked for the wisdom of the Perl Monks concerning the following question:
when I have a form with several checkboxes like that:
When trying to process it under Mason I stumble about really kludgy processing: If none or only one checkbox is checked, $ARGS{lookup} behaves like a scalar where the value is the value of the checkbox.<input type=checkbox name=lookup value="exact" checked> <% _('exact') +%><br> <input type=checkbox name=lookup value="partof"> <% _ +('part-of') %><br> <input type=checkbox name=lookup value="morph"> <% _( +'morphology') %><br> <input type=checkbox name=lookup value="fuzzy"> <% _( +'fuzzy') %><br> <input type=checkbox name=lookup value="regex"> <% _( +'regex') %>
BUT
If more than one checkboxes are checked, $ARGS{lookup} is a reference to an array. An ARRAY? Hell how should I know, which element index corresponds to what value? If I check exact and partof, $ARGS{lookup}[1] is "partof", but if I check exact and morphology, $ARGS{lookup}[1] is "morph".
There must be a better / working way to solve this!?
Bye
PetaMem All Perl: MT, NLP, NLU
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Mason and (multiple) checkbox processing
by shenme (Priest) on Oct 28, 2004 at 20:45 UTC | |
|
Re: Mason and (multiple) checkbox processing
by ikegami (Patriarch) on Oct 28, 2004 at 20:29 UTC | |
by PetaMem (Priest) on Oct 30, 2004 at 22:05 UTC | |
|
Re: Mason and (multiple) checkbox processing
by PodMaster (Abbot) on Oct 29, 2004 at 09:43 UTC |