Merge pull request #361 from halkyon/formfield_doc_changes

MINOR Documentation on EmailField type attribute change
This commit is contained in:
Will Rossiter 2012-04-22 01:48:39 -07:00
commit 2bbb7cd914
2 changed files with 12 additions and 1 deletions

View File

@ -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,

View File

@ -316,7 +316,7 @@ class FormField extends RequestHandler {
/**
* Set an HTML attribute on the field element, mostly an <input> 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}