[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
[mv] Multiple values in the same form variable
****** message to minivend-users from "Christopher Thompson" <ct@arborinternet.com> ******
I always forget this one, and since I was just working on some related
code I thought I would contribute a little code snippet that people might
use.
For coordinated searches or for checkbox inputs, multiple values are
placed in the same form variable. The values are separated by Nulls
(that's the thing I always forget). Here is some code to convert to a
comma separated string for use in [loop] tags, etc. This is not optimized
Perl, but I wanted it to be understandable.
[perl values]
@array = split (/\0/, $Safe{'values'}{'mv_searchspec'});
$str = join (",", @array);
return $str;
[/perl]
You could obviously assign to another variable rather, than $str. There
are many variations. Maybe an example of this could be added to the docs
or a usertag created to do this.
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list