HTML::FormFu::Constraint::Required - Required Field Constraint


HTML-FormFu documentation Contained in the HTML-FormFu distribution.

Index


Code Index:

NAME

Top

HTML::FormFu::Constraint::Required - Required Field Constraint

DESCRIPTION

Top

States that a value must be submitted. The empty string is not allowed.

SEE ALSO

Top

Is a sub-class of, and inherits methods from HTML::FormFu::Constraint

HTML::FormFu

AUTHOR

Top

Carl Franks, cfranks@cpan.org

Based on the original source code of HTML::Widget::Constraint::All, by Sebastian Riedel, sri@oook.de.

LICENSE

Top

This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.


HTML-FormFu documentation Contained in the HTML-FormFu distribution.

package HTML::FormFu::Constraint::Required;

use Moose;
extends 'HTML::FormFu::Constraint';

sub constrain_value {
    my ( $self, $value ) = @_;

    return defined $value && length $value;
}

__PACKAGE__->meta->make_immutable;

1;

__END__