Add the ability to find named elements or IDs inside of forms when using the fil…
…l method. This change gives priority to the name attribute, but in the event it isn't able to find an element, it tries again using the ID.
Showing
1 changed file
with
1 additions
and
1 deletions
... | @@ -226,7 +226,7 @@ | ... | @@ -226,7 +226,7 @@ |
226 | if (!vals.hasOwnProperty(name)) { | 226 | if (!vals.hasOwnProperty(name)) { |
227 | continue; | 227 | continue; |
228 | } | 228 | } |
229 | var field = this.findAll('[name="' + name + '"]', form); | 229 | var field = this.findAll('[name="' + name + '"]', form) || this.findAll('#' + name, form); |
230 | var value = vals[name]; | 230 | var value = vals[name]; |
231 | if (!field || field.length === 0) { | 231 | if (!field || field.length === 0) { |
232 | out.errors.push('no field named "' + name + '" in form'); | 232 | out.errors.push('no field named "' + name + '" in form'); | ... | ... |
-
Please register or sign in to post a comment