From e12a82e28fe07c4d33ba6ce39d0b4bb1e421018e Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Sat, 21 Apr 2012 11:05:47 +1200 Subject: [PATCH] MINOR Documentation on EmailField type attribute change --- docs/en/changelogs/3.0.0.md | 11 +++++++++++ forms/FormField.php | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/en/changelogs/3.0.0.md b/docs/en/changelogs/3.0.0.md index 0ea9fe950..afee64fda 100644 --- a/docs/en/changelogs/3.0.0.md +++ b/docs/en/changelogs/3.0.0.md @@ -8,6 +8,7 @@ * Image/Link insertion moved into a modal dialog instead of a sidebar * "Add pages" dropdown moved to a more descriptive modal dialog * Renaming of sapphire to SilverStripe framework + * FormField classes now have their own HTML templates * Allow usage of SilverStripe framework without the "cms" module * CMS JavaScript moved to [jQuery.entwine](https://github.com/hafriedlander/jquery.entwine) * CMS stylesheets are generated by SCSS to provide more flexible and robust styling @@ -385,6 +386,16 @@ its no longer possible to set the following optional attributes via constructor and `$folderName` (for `FileField` and `SimpleImageField`). Please use the appropriate setters on the form field instance instead. +### EmailField now uses type "email" instead of type "text" [email-form-field] ### + +EmailField now uses "email" for the `type` attribute, which integrates better with HTML5 features like +form validation in the browser. + +If you want to change this back to "text", use `setAttribute()` when constructing the field: + + $field = new EmailField('Email'); + $field->setAttribute('type', 'text'); + ### Restructured files and folders [file-restructure]### In order to make the SilverStripe framework useable without the `cms` module, diff --git a/forms/FormField.php b/forms/FormField.php index e9e63ea4d..dbc26b479 100644 --- a/forms/FormField.php +++ b/forms/FormField.php @@ -316,7 +316,7 @@ class FormField extends RequestHandler { /** * Set an HTML attribute on the field element, mostly an tag. * - * Some attributes are best set through more specialized methods, to avoid interfereing with built-in behaviour: + * Some attributes are best set through more specialized methods, to avoid interfering with built-in behaviour: * - 'class': {@link addExtraClass()} * - 'title': {@link setDescription()} * - 'value': {@link setValue}