field industry => { required => 0, min_length => 1, max_length => 255, validation => sub { _validate_industry( @_ ) }, label => 'Industry', }; $form = MyApp::Form::Customer->new( params => { industry => [ $query->param('industry') ] } ); #### sub _validate_keywords { my ($self, $this, $params) = @_; if ( $params->{ keywords } eq '-' && $params->{ industry } eq '-' ) { $self->error($this, "You must enter some keywords or choose an industry."); } return 1; } sub _validate_industry { my ($self, $this, $params) = @_; if ( $params->{ keywords } eq '-' && $params->{ industry } eq '-' ) { $self->error($this, "You must enter some keywords or choose an industry."); } return 1; } $form = MyApp::Form::Customer->new( params => { industry => $query->param('industry') || '-', keywords => $query->param('keywords') || '-',