[ic] separating out mv_searchspec and mv_search_field

Paul Jordan interchange-users@icdevgroup.org
Mon Sep 30 19:14:00 2002


> In one instance I have a "joined search" and thus the
> following may return 3 searchspecs and 3 search fields
> depending if the form on the search page was
> completely filled or not.
>
> [cgi name=mv_searchspec filter=null_to_space keep=1]
> [cgi name=mv_search_field filter=null_to_space keep=1]
>
> I would like to separate the searchspecs and fields
> individually so i can put them in a form sort of like
> this
>
> <input type=hidden name=mv_searchspec
> value="first_searchspec">
> <input type=hidden name=mv_search_field
> value="first_search field">
> [if second_searchspec]
> <input type=hidden name=mv_searchspec
> value="second_searchspec">
> <input type=hidden name=mv_search_field
> value="second_search field">
> [/if]
> [if third_searchspec]
> <input type=hidden name=mv_searchspec
> value="third_searchspec">
> <input type=hidden name=mv_search_field
> value="third_search field">
> [/if]
>
> Is there a way to pull out the values individually
> that are contained in the searchspec and search_field.
>
> Thanks in advance
> Tom


Hi Tom

Here is a calc I use to process terms entered from a previous page for
input. it seperates the values from each corresponding input and outputs IC
search terms. Ed Lafrance of New Media EMS helped me with this a while back.
He did the calc, when he was done I realized all the cool things that can be
done with perl, so I started learning it :) Of course you still need to
build the actual search this [tmp goodwords] fits into.


[tmp goodwords][calc]
         my @word = split /\s+/, $CGI->{findthis} || $Values->{findthis};
         my $out;
         foreach (@word) {
                 $out .= "sf=:*\nse=$_\nop=rm\nnu=0\n";
         }
         return $out;
[/calc][/tmp]


HTH
Paul