MDL-52826 forms: Move global functions to self-contained
This commit is contained in:
@@ -1061,9 +1061,6 @@ class HTML_QuickForm extends HTML_Common {
|
||||
if (!isset($this->_rules[$element])) {
|
||||
$this->_rules[$element] = array();
|
||||
}
|
||||
if ($validation == 'client') {
|
||||
$this->updateAttributes(array('onsubmit' => 'try { var myValidator = validate_' . $this->_attributes['id'] . '; } catch(e) { return true; } return myValidator(this);'));
|
||||
}
|
||||
$this->_rules[$element][] = array(
|
||||
'type' => $type,
|
||||
'format' => $format,
|
||||
@@ -1132,9 +1129,6 @@ class HTML_QuickForm extends HTML_Common {
|
||||
$this->_required[] = $elementName;
|
||||
$required++;
|
||||
}
|
||||
if ('client' == $validation) {
|
||||
$this->updateAttributes(array('onsubmit' => 'try { var myValidator = validate_' . $this->_attributes['id'] . '; } catch(e) { return true; } return myValidator(this);'));
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($required > 0 && count($groupObj->getElements()) == $required) {
|
||||
@@ -1166,9 +1160,6 @@ class HTML_QuickForm extends HTML_Common {
|
||||
if ($type == 'required') {
|
||||
$this->_required[] = $group;
|
||||
}
|
||||
if ($validation == 'client') {
|
||||
$this->updateAttributes(array('onsubmit' => 'try { var myValidator = validate_' . $this->_attributes['id'] . '; } catch(e) { return true; } return myValidator(this);'));
|
||||
}
|
||||
}
|
||||
} // end func addGroupRule
|
||||
|
||||
|
||||
@@ -267,7 +267,7 @@ class HTML_QuickForm_Renderer_Tableless extends HTML_QuickForm_Renderer_Default
|
||||
$this->_html = str_replace('></label>', '> </label>', $this->_html);
|
||||
// add a validation script
|
||||
if ('' != ($script = $form->getValidationScript())) {
|
||||
$this->_html = $script . "\n" . $this->_html;
|
||||
$this->_html = $this->_html . "\n" . $script;
|
||||
}
|
||||
} // end func finishForm
|
||||
|
||||
|
||||
Reference in New Issue
Block a user