| HTML-Widget documentation | Contained in the HTML-Widget distribution. |
HTML::Widget::Constraint::SingleValue - SingleValue Constraint
my $c = $widget->constraint( 'SingleValue', 'foo' );
Ensures that multiple values were not submitted for the named element.
Carl Franks, cfranks@cpan.org
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
| HTML-Widget documentation | Contained in the HTML-Widget distribution. |
package HTML::Widget::Constraint::SingleValue; use warnings; use strict; use base 'HTML::Widget::Constraint';
sub process { my ( $self, $w, $params ) = @_; my $results = []; my ($name) = @{ $self->names }; if ( ref $params->{$name} ) { push @$results, HTML::Widget::Error->new( { name => $name, message => $self->mk_message } ); } return $results; }
1;