Form: allow checkboxes to be required

This commit is contained in:
Alexander A. Klimov 2019-12-01 19:31:19 +01:00 committed by Johannes Meyer
parent f872a95cc5
commit 568619b92e
1 changed files with 1 additions and 1 deletions

View File

@ -1015,7 +1015,7 @@ class Form extends Zend_Form
*/
public function ensureElementAccessibility(Zend_Form_Element $element)
{
if ($element->isRequired() && strpos(strtolower($element->getType()), 'checkbox') === false) {
if ($element->isRequired()) {
$element->setAttrib('aria-required', 'true'); // ARIA
$element->setAttrib('required', ''); // HTML5
if (($cue = $this->getRequiredCue()) !== null && ($label = $element->getDecorator('label')) !== false) {