in reply to Mason and (multiple) checkbox processing

You should probably give your boxes different names (name=partof, name=morph, etc). You don't even need to specify a value=.

If not, you can fix it up in code as follows:

my %lookup; { my $lookup = $ARGS{lookup}; if (ref($lookup)) { $lookup{$lookup} = 1; } else { $lookup{$_} = 1 foreach (@$lookup); } } print($_, ': ', ($lookup{$_}?"checked":"not checked"), $/) foreach (qw(partof morph fuzzy regex));

There might be a better way, but I don't know Mason at all.

Replies are listed 'Best First'.
Re^2: Mason and (multiple) checkbox processing
by PetaMem (Priest) on Oct 30, 2004 at 22:05 UTC
    You should probably give your boxes different names (name=partof, name=morph, etc)

    Bad idea IMHO. If you happen to combine a form out of several (mason) components and there is even a possibility, that someone in the future will add some components, you just pollute the namespace of the form that way. Of course, a programmer has to look at the code/docs before doing some extensions, but using same name different values, you reduce the number he has to cross-check from m * n to n.

    Bye
     PetaMem
        All Perl:   MT, NLP, NLU