<%doc> ############################################################################### # backend code for most asynchronous javascript queries ############################################################################### <%args> $table => $ARGS{table}; $field => $ARGS{field}; $val => $ARGS{crit}; $search_field => $ARGS{search_field}; $caller => $ARGS{self}; <%init> my @terms; my $DEBUG = 0; my $MAX = $ui->config->get('DEFAULT_SELECTMAX'); <%perl> print "
 ", Dumper(%ARGS), "

" if $DEBUG; if ($val =~ /\w+/) { if ($val =~ /\w+\s+\w+/) { # if there's more than one word @terms = split /\s+/, $val; } else { $val =~ s/\s+//; push @terms, $val; } print "terms are: ", join ', ', @terms, "
" if $DEBUG; }