From 329b82845e03dc31d9f3767223982b5282897145 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Sat, 22 Oct 2011 15:22:39 +0000 Subject: [PATCH] fix a bug in Ox.Form, regarding error messages on submit --- source/Ox.UI/js/Form/Ox.Form.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/Ox.UI/js/Form/Ox.Form.js b/source/Ox.UI/js/Form/Ox.Form.js index b126afd9..ab5925c8 100644 --- a/source/Ox.UI/js/Form/Ox.Form.js +++ b/source/Ox.UI/js/Form/Ox.Form.js @@ -86,12 +86,11 @@ Ox.Form = function(options, self) { function submitCallback(data) { data.forEach(function(v, i) { - self.$items[i].setMessage(v.message); + self.$items[getItemIndexById(v.id)].setMessage(v.message); }); } function validate(pos, valid) { - //Ox.print('FORM validate', pos, valid) self.itemIsValid[pos] = valid; if (Ox.every(self.itemIsValid) != self.formIsValid) { self.formIsValid = !self.formIsValid;