Leser: 1
3 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
sub validate {
my $self = shift;
my $q = $self->query();
#print STDERR;
#print STDERR Data::Dumper::Dumper($self->param('dfv_profile'));
my $results = Data::FormValidator->check($q->Vars(), $self->param('dfv_profile'));
#print STDERR;
if( $results->has_missing() # This method returns true if the results contains missing fields.
or $results->has_invalid() # This method returns true if the results contains fields with invalid data.
or $results->has_unknown() ){ # This method returns true if the results contains unknown fields.
# Fehler, redirect to showErrorForm
return 'error validate';
}elsif( $self->param('go2success') ){
# ok, redirect to showSuccess
}else{
# ok, redirect to showReview
return 'else validate';
}
return 'validate';
} # /validate
Error executing run mode 'validate': No such profile validate
Quote$VAR1 = {
'constraints' => {
'eMail' => {
'name' => 'emailValid',
'constraint' => qr/(?-xism:^[\w\d][\w\d\.\-]*\@([\w\d\-]+\.)+[a-zA-Z]{2,4}$)/
}
},
'required' => [],
'msgs' => {
'constraints' => {
'emailValid' => 'Bitte geben Sie eine gültige eMail-Adresse ein'
},
'format' => 'Fehler: %s',
'missing' => 'Fehlend!',
'any_errors' => 'Error',
'invalid_seperator' => '',
'invalid' => 'Problematisch!',
'prefix' => 'error_'
}
};
QuoteIf you use CGI.pm to handle accessing the form data, there's no easy way to send $q to the FormValidator since it wants a hash. There is a little known function Vars() that will do this conversion for you.
my %fdat = $q->Vars;
3 Einträge, 1 Seite |