mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-30839 Accessibility, Forms - Improve accessibility or error messages
This commit is contained in:
parent
14e8af6687
commit
790b3da848
2 changed files with 7 additions and 3 deletions
|
@ -1952,6 +1952,8 @@ function qf_errorHandler(element, _qfMsg) {
|
||||||
errorSpan.id = \'id_error_\'+element.name;
|
errorSpan.id = \'id_error_\'+element.name;
|
||||||
errorSpan.className = "error";
|
errorSpan.className = "error";
|
||||||
element.parentNode.insertBefore(errorSpan, element.parentNode.firstChild);
|
element.parentNode.insertBefore(errorSpan, element.parentNode.firstChild);
|
||||||
|
document.getElementById(errorSpan.id).setAttribute(\'TabIndex\', \'0\');
|
||||||
|
document.getElementById(errorSpan.id).focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
while (errorSpan.firstChild) {
|
while (errorSpan.firstChild) {
|
||||||
|
@ -1959,11 +1961,12 @@ function qf_errorHandler(element, _qfMsg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
errorSpan.appendChild(document.createTextNode(_qfMsg.substring(3)));
|
errorSpan.appendChild(document.createTextNode(_qfMsg.substring(3)));
|
||||||
errorSpan.appendChild(document.createElement("br"));
|
|
||||||
|
|
||||||
if (div.className.substr(div.className.length - 6, 6) != " error"
|
if (div.className.substr(div.className.length - 6, 6) != " error"
|
||||||
&& div.className != "error") {
|
&& div.className != "error") {
|
||||||
div.className += " error";
|
div.className += " error";
|
||||||
|
linebreak = document.createElement("br");
|
||||||
|
errorSpan.parentNode.insertBefore(linebreak, errorSpan.nextSibling);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -241,6 +241,7 @@ a.skip:active {position: static;display: block;}
|
||||||
.dir-rtl .mform .fitem fieldset.felement {padding-right: 1%;margin-right: 15%;}
|
.dir-rtl .mform .fitem fieldset.felement {padding-right: 1%;margin-right: 15%;}
|
||||||
.mform .error,
|
.mform .error,
|
||||||
.mform .required {color:#A00;}
|
.mform .required {color:#A00;}
|
||||||
|
.mform span.error {display: inline-block;padding: 4px;margin-bottom: 4px;background-color: #F2DEDE;border: 1px solid #EED3D7;}
|
||||||
.mform .required .fgroup span label {color:#000;}
|
.mform .required .fgroup span label {color:#000;}
|
||||||
.mform .fdescription.required {color:#A00;text-align:right;}
|
.mform .fdescription.required {color:#A00;text-align:right;}
|
||||||
.mform .fpassword .unmask {display:inline;margin-left:0.5em;}
|
.mform .fpassword .unmask {display:inline;margin-left:0.5em;}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue