fix processing true
returned by validate method, fix #155
This commit is contained in:
parent
b73522b405
commit
28e1f68cd3
@ -181,7 +181,7 @@ Editableform is linked with one of input types, e.g. 'text', 'select' etc.
|
|||||||
} else {
|
} else {
|
||||||
//convert newline to <br> for more pretty error display
|
//convert newline to <br> for more pretty error display
|
||||||
if(msg) {
|
if(msg) {
|
||||||
lines = msg.split("\n");
|
lines = (''+msg).split('\n');
|
||||||
for (var i = 0; i < lines.length; i++) {
|
for (var i = 0; i < lines.length; i++) {
|
||||||
lines[i] = $('<div>').text(lines[i]).html();
|
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.stopPropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
var error,
|
//get new value from input
|
||||||
newValue = this.input.input2value(); //get new value from input
|
var newValue = this.input.input2value();
|
||||||
|
|
||||||
//validation
|
// validation: if validate returns truthy value - means error
|
||||||
if (error = this.validate(newValue)) {
|
var error = this.validate(newValue)
|
||||||
|
if (error) {
|
||||||
this.error(error);
|
this.error(error);
|
||||||
this.showForm();
|
this.showForm();
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user