fix processing true returned by validate method, fix

This commit is contained in:
vitalets 2013-10-04 21:33:39 +04:00
parent b73522b405
commit 28e1f68cd3

@ -181,7 +181,7 @@ Editableform is linked with one of input types, e.g. 'text', 'select' etc.
} else {
//convert newline to <br> for more pretty error display
if(msg) {
lines = msg.split("\n");
lines = (''+msg).split('\n');
for (var i = 0; i < lines.length; i++) {
lines[i] = $('<div>').text(lines[i]).html();
}
@ -196,11 +196,12 @@ Editableform is linked with one of input types, e.g. 'text', 'select' etc.
e.stopPropagation();
e.preventDefault();
var error,
newValue = this.input.input2value(); //get new value from input
//get new value from input
var newValue = this.input.input2value();
//validation
if (error = this.validate(newValue)) {
// validation: if validate returns truthy value - means error
var error = this.validate(newValue)
if (error) {
this.error(error);
this.showForm();
return;