[ic] Intercept / Correct mv_searchspec

Phil Smith phil.smith at phil-home.com
Tue Jun 26 14:22:06 UTC 2012

>Quoting IC (ic at tvcables.co.uk):
>> Hi folks,
>> I am trying to intercept mv_searchspec from the small search component 
>> and correct a common spelling difference:-
>> So far this is my non working code in the small search component:-
>>       <INPUT MAXLENGTH=30 NAME="[value mv_searchspec]" type=text size=15>
>> 	      [tmp sspec][perl]
>> 	      my $correct = $Values->{mv_searchspec}->[0];
>> 	      $correct =~ s/adaptor/adapter/g;
>> 	      return $correct;    
>> 	      [/perl][/tmp]
>>       <input type=hidden name=mv_searchspec value=[scratch sspec]>
>> It doesn't work, please help!
>I think you'd want the Perl stuff on your results page (probably
search.html). In that case, you won't need the scratch, but can reset the
Values space (although I haven't tested this).

Looking at your code - it would appear to me that this will be run as IC is
rendering the page (before the user has mis-typed the searchspec).

As Josh said above, either move this to the results page - or add an
mv_click callback to clean the mv_searchspec before the form is submitted


More information about the interchange-users mailing list