Commit 1e091639 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Merge remote-tracking branch 'origin/raos_work' into crose_work

parents c7f17545 09ac0f52
......@@ -118,12 +118,20 @@ var QfqNS = QfqNS || {};
*/
n.Form.prototype.validate = function () {
this.eventEmitter.emitEvent('form.validation.before', n.EventEmitter.makePayload(this, null));
var isValid;
var form = document.forms[this.formId];
var $form = $(form);
if ($form.data('bs.validator')) {
$form.validator('validate');
isValid = !$form.data('bs.validator').hasErrors();
} else {
isValid = form.checkValidity();
}
var result = document.forms[this.formId].checkValidity();
this.eventEmitter.emitEvent('form.validation.after', n.EventEmitter.makePayload(this, {validationResult: result}));
this.eventEmitter.emitEvent('form.validation.after', n.EventEmitter.makePayload(this, {validationResult: isValid}));
return result;
return isValid;
};
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment