1
0
Fork 0
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:
rlx 2011-10-22 14:50:31 +00:00
commit cfc5baef61
4 changed files with 23 additions and 14 deletions

View file

@ -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