Skip to content

Commit

Permalink
applying the same patch to advcheckbox, backported from HEAD - Fixes …
Browse files Browse the repository at this point in the history
…MDL-8627, "HTML QuickForm displays (some?) disabled elements in a non-accessible way", overrides parent::getFrozenHtml.
  • Loading branch information
skodak committed Sep 15, 2007
1 parent 45d99c3 commit 5a9528b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/form/advcheckbox.php
Expand Up @@ -89,5 +89,22 @@ function _generateId()
}
} // end func _generateId

/**
* Returns the disabled field. Accessibility: the return "[ ]" from parent
* class is not acceptable for screenreader users, and we DO want a label.
* @return string
*/
function getFrozenHtml()
{
//$this->_generateId();
$output = '<input type="checkbox" disabled="disabled" id="'.$this->getAttribute('id').'" ';
if ($this->getChecked()) {
$output .= 'checked="checked" />'.$this->_getPersistantData();
} else {
$output .= '/>';
}
return $output;
} //end func getFrozenHtml

}
?>

0 comments on commit 5a9528b

Please sign in to comment.