diff options
-rwxr-xr-x | kontakt.cgi | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/kontakt.cgi b/kontakt.cgi index a860a9d..cfe9a08 100755 --- a/kontakt.cgi +++ b/kontakt.cgi @@ -22,6 +22,8 @@ my ($confirm) = 1; # Built-in email validation is too simplistic my $valid_email = '/^[+_A-Za-z0-9-]+(\.[+_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(\.[_A-Za-z0-9-]+)$/'; +my $valid_dk_zip = '/^([Dd][Kk])?.?[0-9-]{4}$/'; + my $form = CGI::FormBuilder->new( lang => 'da', title => 'Henvendelse til Byvandring.nu', @@ -37,8 +39,11 @@ my $form = CGI::FormBuilder->new( kommentar /], validate => { + postnr => $valid_zip_dk, + _postnr => $valid_zip_dk, #fake check to silence warning of variable used only once email => $valid_email, _email => $valid_email, #fake check to silence warning of variable used only once + antal => 'INT', }, required => [qw/ email |