Skip to content

Commit

Permalink
ENHANCEMENT EmailField now uses type="email", which has the benefit of
Browse files Browse the repository at this point in the history
allowing email validation when using the required="required" attribute.
If using an old browser, the "email" type will fallback to "text"
  • Loading branch information
Sean Harvey committed Apr 19, 2012
1 parent 7dc5eb0 commit 23c3fb8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions forms/EmailField.php
Expand Up @@ -10,6 +10,14 @@ function Type() {
return 'email text';
}

function getAttributes() {
$attrs = array(
'type' => 'email',
);

return array_merge($attrs, $this->attributes);
}

/**
* Validates for RFC 2822 compliant email adresses.
*
Expand Down

0 comments on commit 23c3fb8

Please sign in to comment.