forked from 0x2620/oxjs
change autovalidate function for input elements so that it returns, along with the new value, a valid flag that indicates if the value is already valid
This commit is contained in:
parent
7ea6938de5
commit
cfc5baef61
4 changed files with 23 additions and 14 deletions
|
|
@ -51,7 +51,6 @@ Ox.Form = function(options, self) {
|
|||
},
|
||||
*/
|
||||
autovalidate: function(data) {
|
||||
data.valid = !!data.value.length;
|
||||
validate(i, data.valid);
|
||||
data.valid && self.$items[i].setMessage('');
|
||||
},
|
||||
|
|
@ -65,6 +64,7 @@ Ox.Form = function(options, self) {
|
|||
},
|
||||
*/
|
||||
change: function(data) {
|
||||
// fixme: shouldn't this be key/value instead of id/data?
|
||||
that.triggerEvent('change', {
|
||||
id: self.itemIds[i],
|
||||
data: data
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue