mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
Merge branch 'wip-mdl-27728' of git://github.com/rajeshtaneja/moodle
This commit is contained in:
commit
c4e560099c
@ -1731,6 +1731,12 @@ var skipClientValidation = false;
|
||||
|
||||
function qf_errorHandler(element, _qfMsg) {
|
||||
div = element.parentNode;
|
||||
|
||||
if ((div == undefined) || (element.name == undefined)) {
|
||||
//no checking can be done for undefined elements so let server handle it.
|
||||
return true;
|
||||
}
|
||||
|
||||
if (_qfMsg != \'\') {
|
||||
var errorSpan = document.getElementById(\'id_error_\'+element.name);
|
||||
if (!errorSpan) {
|
||||
@ -1780,16 +1786,25 @@ function qf_errorHandler(element, _qfMsg) {
|
||||
$elementName);
|
||||
$js .= '
|
||||
function validate_' . $this->_formName . '_' . $escapedElementName . '(element) {
|
||||
if (undefined == element) {
|
||||
//required element was not found, then let form be submitted without client side validation
|
||||
return true;
|
||||
}
|
||||
var value = \'\';
|
||||
var errFlag = new Array();
|
||||
var _qfGroups = {};
|
||||
var _qfMsg = \'\';
|
||||
var frm = element.parentNode;
|
||||
while (frm && frm.nodeName.toUpperCase() != "FORM") {
|
||||
frm = frm.parentNode;
|
||||
if ((undefined != element.name) && (frm != undefined)) {
|
||||
while (frm && frm.nodeName.toUpperCase() != "FORM") {
|
||||
frm = frm.parentNode;
|
||||
}
|
||||
' . join("\n", $jsArr) . '
|
||||
return qf_errorHandler(element, _qfMsg);
|
||||
} else {
|
||||
//element name should be defined else error msg will not be displayed.
|
||||
return true;
|
||||
}
|
||||
' . join("\n", $jsArr) . '
|
||||
return qf_errorHandler(element, _qfMsg);
|
||||
}
|
||||
';
|
||||
$validateJS .= '
|
||||
|
Loading…
x
Reference in New Issue
Block a user