diff --git a/war/resources/scripts/prototype.js b/war/resources/scripts/prototype.js index a3f21ac790995f83f0d7e1dfc8a448d7580d035b..2f143097e86f108ed4760bc6d13877485b762c87 100644 --- a/war/resources/scripts/prototype.js +++ b/war/resources/scripts/prototype.js @@ -2664,15 +2664,22 @@ Form.Methods = { getInputs: function(form, typeName, name) { form = $(form); var inputs = form.getElementsByTagName('input'); + var textareas = form.getElementsByTagName('textarea'); - if (!typeName && !name) return $A(inputs).map(Element.extend); + if (!typeName && !name) return $A(inputs).concat($A(textareas)).map(Element.extend); - for (var i = 0, matchingInputs = [], 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)); - } + + 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); return matchingInputs; },