MDL-7778 fixed cancel button failing on some pages (I hope)
This commit is contained in:
+1
-1
@@ -27,7 +27,7 @@ class MoodleQuickForm_cancel extends HTML_QuickForm_submit
|
||||
$value=get_string('cancel');
|
||||
}
|
||||
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
|
||||
function onQuickFormEvent($event, $arg, &$caller)
|
||||
{
|
||||
|
||||
@@ -733,6 +733,9 @@ class MoodleQuickForm extends HTML_QuickForm_DHTMLRulesTableless {
|
||||
$js = '
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
|
||||
var skipClientValidation = false;
|
||||
|
||||
function qf_errorHandler(element, _qfMsg) {
|
||||
div = element.parentNode;
|
||||
if (_qfMsg != \'\') {
|
||||
@@ -809,6 +812,9 @@ function validate_' . $this->_attributes['id'] . '_' . $elementName . '(element)
|
||||
}
|
||||
$js .= '
|
||||
function validate_' . $this->_attributes['id'] . '(frm) {
|
||||
if (skipClientValidation) {
|
||||
return true;
|
||||
}
|
||||
var ret = true;
|
||||
' . $validateJS . ';
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user