Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ENHANCEMENT EmailField now uses type="email", which has the benefit of

allowing email validation when using the required="required" attribute.
If using an old browser, the "email" type will fallback to "text"
  • Loading branch information...
commit 23c3fb83fb4fc1f7833a664ce669d2f8386b4f09 1 parent 7dc5eb0
@halkyon halkyon authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 forms/EmailField.php
View
8 forms/EmailField.php
@@ -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.
*
Please sign in to comment.
Something went wrong with that request. Please try again.