Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Email validation improvements #54

Merged
merged 2 commits into from

2 participants

@tomhukins

Hi,

Thank you for adding the 'email_valid_params' to HTML::FormHandler>>Field recently. I'm already using the feature at work, so I look forward to seeing it released to CPAN. :)

I hope you find these patches useful.

Tom

tomhukins added some commits
@tomhukins tomhukins Document the new 'email_valid_params' attribute
d8ae8b6 added code for this feature without documentation.
b057fde
@tomhukins tomhukins Ensure validation checks the specified address
If the 'email_valid_params' contains a field with the key '-address',
always override that value with the value from the form field.
8f92269
@gshank gshank merged commit 7dfda6e into gshank:master
@tomhukins tomhukins deleted the tomhukins:email_valid branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 21, 2013
  1. @tomhukins

    Document the new 'email_valid_params' attribute

    tomhukins authored
    d8ae8b6 added code for this feature without documentation.
  2. @tomhukins

    Ensure validation checks the specified address

    tomhukins authored
    If the 'email_valid_params' contains a field with the key '-address',
    always override that value with the value from the form field.
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/HTML/FormHandler/Field/Email.pm
View
6 lib/HTML/FormHandler/Field/Email.pm
@@ -33,8 +33,8 @@ apply(
check => sub {
my ( $value, $field ) = @_;
my $checked = Email::Valid->address(
- -address => $value,
%{ $field->email_valid_params || {} },
+ -address => $value,
);
$field->value($checked)
if $checked;
@@ -55,6 +55,10 @@ Widget type is 'text'.
If form has 'is_html5' flag active it will render <input type="email" ... />
instead of type="text"
+This field has an 'email_valid_params' attribute that accepts a hash
+reference of extra values passed to L<Email::Valid/address> when
+validating email addresses.
+
=head1 DEPENDENCIES
L<Email::Valid>
Something went wrong with that request. Please try again.