mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
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"
This commit is contained in:
parent
7dc5eb0cdc
commit
23c3fb83fb
@ -10,6 +10,14 @@ class EmailField extends TextField {
|
|||||||
return 'email text';
|
return 'email text';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getAttributes() {
|
||||||
|
$attrs = array(
|
||||||
|
'type' => 'email',
|
||||||
|
);
|
||||||
|
|
||||||
|
return array_merge($attrs, $this->attributes);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validates for RFC 2822 compliant email adresses.
|
* Validates for RFC 2822 compliant email adresses.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user