Commit 5e30494e authored by webchick's avatar webchick

Issue #2047075 by Caecus, mgifford, jessebeach, larowlan: Mark invalid form...

Issue #2047075 by Caecus, mgifford, jessebeach, larowlan: Mark invalid form field with [aria-invalid=true].
parent aac3160d
......@@ -4842,6 +4842,7 @@ function _form_set_attributes(&$element, $class = array()) {
}
if (isset($element['#parents']) && form_get_error($element) !== NULL && !empty($element['#validated'])) {
$element['#attributes']['class'][] = 'error';
$element['#attributes']['aria-invalid'] = 'true';
}
}
......
......@@ -248,6 +248,9 @@ function testRequiredTextfieldNoTitle() {
// Check the page for the error class on the textfield.
$this->assertFieldByXPath('//input[contains(@class, "error")]', FALSE, 'Error input form element class found.');
// Check the page for the aria-invalid attribute on the textfield.
$this->assertFieldByXPath('//input[contains(@aria-invalid, "true")]', FALSE, 'Aria invalid attribute found.');
// Submit again with required fields set and verify that there are no
// error messages.
$edit = array(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment