mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-7778 fixed cancel button failing on some pages (I hope)
This commit is contained in:
parent
f24a257d85
commit
1cbb09f1d1
2 changed files with 7 additions and 1 deletions
|
@ -27,7 +27,7 @@ class MoodleQuickForm_cancel extends HTML_QuickForm_submit
|
||||||
$value=get_string('cancel');
|
$value=get_string('cancel');
|
||||||
}
|
}
|
||||||
HTML_QuickForm_submit::HTML_QuickForm_submit($elementName, $value, $attributes);
|
HTML_QuickForm_submit::HTML_QuickForm_submit($elementName, $value, $attributes);
|
||||||
$this->updateAttributes(array('onclick'=>'return this.form.submit();'));
|
$this->updateAttributes(array('onclick'=>'skipClientValidation = true; return true;'));
|
||||||
} //end constructor
|
} //end constructor
|
||||||
function onQuickFormEvent($event, $arg, &$caller)
|
function onQuickFormEvent($event, $arg, &$caller)
|
||||||
{
|
{
|
||||||
|
|
|
@ -733,6 +733,9 @@ class MoodleQuickForm extends HTML_QuickForm_DHTMLRulesTableless {
|
||||||
$js = '
|
$js = '
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
//<![CDATA[
|
//<![CDATA[
|
||||||
|
|
||||||
|
var skipClientValidation = false;
|
||||||
|
|
||||||
function qf_errorHandler(element, _qfMsg) {
|
function qf_errorHandler(element, _qfMsg) {
|
||||||
div = element.parentNode;
|
div = element.parentNode;
|
||||||
if (_qfMsg != \'\') {
|
if (_qfMsg != \'\') {
|
||||||
|
@ -809,6 +812,9 @@ function validate_' . $this->_attributes['id'] . '_' . $elementName . '(element)
|
||||||
}
|
}
|
||||||
$js .= '
|
$js .= '
|
||||||
function validate_' . $this->_attributes['id'] . '(frm) {
|
function validate_' . $this->_attributes['id'] . '(frm) {
|
||||||
|
if (skipClientValidation) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
var ret = true;
|
var ret = true;
|
||||||
' . $validateJS . ';
|
' . $validateJS . ';
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue