Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [Andy] The dreaded Multiselect form on input_form.html

Quote Reply
Re: [Andy] The dreaded Multiselect form on input_form.html In reply to
Andy,

Thanks a lot for that very useful global... I had something wrong which caused it not to work. Although it doesn't return selected values for the multiselect field when a user has an error.

I actually found another global in the forums you made to save an array...

sub {
my $tmp = $_[0];
my @array = split /\n/, $tmp;
my @new_array; foreach (@array) {
chomp;
my $tmp_hash;
$tmp_hash->{value} = $_;
push @new_array, $tmp_hash; }
return { features_loop => \@new_array }
}

<%array($features)%>

<option value="None"<%loop features_loop%><%if value eq None%> selected="selected"<%endif%><%endloop%>>------None------</option>
<option value="Option1"<%loop features_loop%><%if value eq Option1%> selected="selected"<%endif%><%endloop%>>Option1</option>
<option value="Option2"<%loop features_loop%><%if value eq Option2%> selected="selected"<%endif%><%endloop%>>Option2</option>

again this works as well but if there an error by users the selected values are lost. Tried many different things including "contains" instead of "eq" with no luck.

Why upon error do these methods only return "true" for the last value in the db stored like this...

None
Option1
Option2
Option3

If anyone knows how to read all values stored after an error I'd love to know.. This is going to drive me nut!

Thanks guys!
Subject Author Views Date
Thread The dreaded Multiselect form on input_form.html Jonze 4746 Mar 27, 2007, 7:47 PM
Post Re: [Jonze] The dreaded Multiselect form on input_form.html
VishalT 4678 Mar 27, 2007, 7:58 PM
Thread Re: [Jonze] The dreaded Multiselect form on input_form.html
brewt 4706 Mar 27, 2007, 8:11 PM
Thread Re: [brewt] The dreaded Multiselect form on input_form.html
Jonze 4656 Mar 28, 2007, 7:44 AM
Thread Re: [Jonze] The dreaded Multiselect form on input_form.html
Andy 4681 Mar 28, 2007, 8:24 AM
Thread Re: [Andy] The dreaded Multiselect form on input_form.html
Jonze 4642 Mar 28, 2007, 8:37 AM
Thread Re: [Jonze] The dreaded Multiselect form on input_form.html
Andy 4685 Mar 28, 2007, 8:44 AM
Post Re: [Andy] The dreaded Multiselect form on input_form.html
Jonze 4647 Mar 28, 2007, 9:02 AM
Post Re: [Andy] The dreaded Multiselect form on input_form.html
Jonze 4587 Mar 29, 2007, 11:42 AM
Thread Re: [Jonze] The dreaded Multiselect form on input_form.html
brewt 4628 Mar 28, 2007, 11:07 AM
Post Re: [brewt] The dreaded Multiselect form on input_form.html
Jonze 4633 Mar 28, 2007, 2:27 PM