Backporting
made to work with <textarea>s, too.
@@ -6408,15 +6408,24 @@ Form.Methods = {
getInputs: function(form, typeName, name) {
form = $(form);
var inputs = form.getElementsByTagName('input');
+ var textareas = form.getElementsByTagName('textarea');
+ // KK patch
+ var selects = form.getElementsByTagName('select');
- if (!typeName && !name) return $A(inputs).map(Element.extend);
+ if (!typeName && !name) return $A(inputs).concat($A(textareas)).concat($A(selects)).map(Element.extend);
- for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) {
+ var matchingInputs = [];
+ var f = function(inputs) {
+ for (var i = 0, length = inputs.length; i < length; i++) {
var input = inputs[i];
if ((typeName && input.type != typeName) || (name && input.name != name))
continue;
matchingInputs.push(Element.extend(input));
}
+ };
+ f(inputs);
+ f(textareas);
+ f(selects);
return matchingInputs;
},
