Akopia Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: [ic] Native joiner for multi-selection form variables



Chris,

The multiple check box selections are seperated with a NUL byte.
You can split and join them in Perl with something like this:

	my @checkboxes = split /\0/, $Values->{checkboxname};
	$Values->{checkboxname} = join '\0', @checkboxes;

or, to store the value(s) in your db you can do this:
	my $checkboxfield = $Values->{checkboxname};
	$checkboxfield =~ s/\0+/ /g;
if you're sure none of the box values has a space in it, or, my
preference:
	$checkboxfield =~ s/\0+/|/g;

Then to put it back on the page after reading from the db, either:
	($Values->{checkboxname} = $checkboxfield) =~ s/\|/\0/g;
or
	($Values->{checkboxname} = $checkboxfield) =~ s/ /\0/g;
depending on which seperator you used.

	-Bill


_______________________________________________
Interchange-users mailing list
Interchange-users@www.minivend.com
http://www.minivend.com/mailman/listinfo/interchange-users


Search for: Match: Format: Sort by: