filter_select — automatically select filter based on HTML widget type


The filter identifies the widget type and returns the name of the corresponding suitable filter for it.


No examples are available at this time. We do consider this a problem and will try to supply some.


Keep in mind that you can specify filter_select along with your custom filters in the same call.


filter_select is available in Interchange versions:

4.6.0-5.9.0 (git-head)


Interchange 5.9.0:

Source: code/Filter/filter_select.filter
Lines: 32

# Copyright 2005-2007 Interchange Development Group and others
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.  See the LICENSE file for details.
# $Id: filter_select.filter,v 1.3 2007-03-30 23:40:44 pajamian Exp $

CodeDef calculated Filter
CodeDef calculated Alias filter_select
CodeDef filter_select Filter
CodeDef filter_select Description Auto-select filter
CodeDef filter_select Visibility private
CodeDef filter_select Version $Revision: 1.3 $
CodeDef filter_select Routine <<EOR
sub {
## This replaces the calculated filter for the survey
## Selects an appropriate filter based on the widget type
my $wid = $CGI->{type};
if($wid =~ /fillin/) {
  return 'nullselect';
elsif($wid =~ /select.*multip/) {
  return 'null_to_comma';
elsif ($wid =~ /checkbox/) {
  return 'checkbox null_to_comma';
return '';


Interchange Development Group


DocBook! Interchange!