mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUG Apply HTML5 required attributes when fields are required.
This commit is contained in:
parent
c78c0aa828
commit
090f07d978
@ -360,6 +360,11 @@ class FormField extends RequestHandler {
|
|||||||
'disabled' => $this->isDisabled(),
|
'disabled' => $this->isDisabled(),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ($this->Required()) {
|
||||||
|
$attrs['required'] = 'required';
|
||||||
|
$attrs['aria-required'] = 'true';
|
||||||
|
}
|
||||||
|
|
||||||
return array_merge($attrs, $this->attributes);
|
return array_merge($attrs, $this->attributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user