Skip to content
This repository
Browse code

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
Sean Harvey authored April 19, 2012

Showing 1 changed file with 8 additions and 0 deletions. Show diff stats Hide diff stats

  1. 8  forms/EmailField.php
8  forms/EmailField.php
@@ -10,6 +10,14 @@ function Type() {
10 10
 		return 'email text';
11 11
 	}
12 12
 
  13
+	function getAttributes() {
  14
+		$attrs = array(
  15
+			'type' => 'email',
  16
+		);
  17
+
  18
+		return array_merge($attrs, $this->attributes);
  19
+	}
  20
+
13 21
 	/**
14 22
 	 * Validates for RFC 2822 compliant email adresses.
15 23
 	 * 

0 notes on commit 23c3fb8

Please sign in to comment.
Something went wrong with that request. Please try again.