the file is being included, it is in the top of my common.js

i am getting the error before it does anything. could it be that my
common.js is not written in the OO style of js?

here is the code;
document.getInputsByAttribute = function(attrib,val){

        //Add-on to Prototype
        var children = document.getElementsByTagName('INPUT');
        var elements = new Array();

        for (var i = 0; i < children.length; i++) {
                if (children[i].getAttribute(attrib) == val){
                        elements.push(children[i]);
                }
        }
        return elements;
}




> On 2/23/06, Louis Walch <[EMAIL PROTECTED]> wrote:
>> i made a function which was a near duplicate of getElementsByClassName
>> and
>> saved it as getInputsByAttribute and saved it in an external js file.
>>
>> but now i am getting "getInputsByAttribute can not be found" is there
>> something i need to do to make it part of prototype?
>
> 1) Are you including your /separate/ JavaScript file into the page
> that you're trying to use it from?
>
> 2) What element (or object) are you attempting to call
> getInputsByAttribute on?
>
> 3) How did you declare the function (or method)?
>
> Show us the code.  A live site is generally preferrable.
>
> Todd
> _______________________________________________
> Rails-spinoffs mailing list
> Rails-spinoffs@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
>
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to