HTML::FormValidator::Constraints - Basic sets of constraints. on input profile.


In an HTML::FormValidator profile:

    constraints  =>
            email       => "email",
            fax         => "american_phone",
            phone       => "american_phone",
            state       => "state",


Those are the builtin constraint that can be specified by name in the input profiles.


Checks if the email LOOKS LIKE an email address. This checks if the input contains one @, and a two level domain name. The address portion is checked quite liberally. For example, all those probably invalid address would pass the test :


This one checks if the input correspond to an american state or a canadian province.


This one checks if the input is a valid two letter abbreviation of an american state.


This checks if the input is a two letter canadian province abbreviation.


This constraints checks if the input is an american zipcode or a canadian postal code.


This constraints checks if the input is a valid Canadian postal code.


This input validator checks if the input is a valid american zipcode : 5 digits followed by an optional mailbox number.


This one checks if the input looks like a phone number, (if it contains at least 6 digits.)


This constraints checks if the number is a possible North American style of phone number : (XXX) XXX-XXXX. It has to contains more than 7 digits.


This is takes two parameters, the credit card number and the credit cart type. You should take the hash reference option for using that constraint.

The number is checked only for plausibility, it checks if the number could be valid for a type of card by checking the checksum and looking at the number of digits and the number of digits of the number.

This functions is only good at weeding typos and such. IT DOESN'T CHECK IF THERE IS AN ACCOUNT ASSOCIATED WITH THE NUMBER.


This one checks if the input is in the format MM/YY or MM/YYYY and if the MM part is a valid month (1-12) and if that date is not in the past.


This one checks if the input field starts by M(asterCard), V(isa), A(merican express) or D(iscovery).


HTML::FormValidator(3) HTML::FormValidator::Filters(3) HTML::FormValidator::ConstraintsFactory(3)


Some of those input validation functions have been taken from MiniVend by Michael J. Heins <>

The credit card checksum validation was taken from contribution by Bruce Albrecht <> to the MiniVend program.


    Francis J. Lacoste <francis.lacoste@iNsu.COM>
    Michael J. Heins <>
    Bruce Albrecht  <>


Copyright (c) 1999 iNsu Innovations Inc. All rights reserved.

Parts Copyright 1996-1999 by Michael J. Heins <> Parts Copyright 1996-1999 by Bruce Albrecht <>

This program is free software; you can redistribute it and/or modify it under the terms as perl itself.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 305:

You forgot a '=back' before '=head1'