Hi ,

I have been trying to extend prototype's DOM extensions to a
collection of radio button inputs with no success whatsoever.

Here is the code:
--------------------------------------------------
var profiles = Form.getInputs("Form1", "radio", "supporter_id");

profiles.each ( function(node)
{
        Event.observe ( node, 'click', function ()
        {

                var tds = this.up(1).immediateDescendants();

                Cookie.set("test", 'FirstName='+tds[3].innerHTML
+'&LastName='+tds[4].innerHTML, 1);

                alert(Cookie.get("test"));

                return false;

        },false );
});
-------------------------------------------------------

which trips up IE. I have tried every which way to extend this,
including but not limited to:


----------------
   profiles.each(function() {
     Element.extend(profiles.each);
   });

-----

profiles.each(Element.extend).invoke

-----


for (i=0;i<profiles.length;i++)
{
        Element.extend(profiles[i]);

}

---------

Element.extend(this);

-----

Nothing seems to work. Now if I name a specific instance of my
collection:

------------------------------
var profiles = Form.getInputs("Form1", "radio", "supporter_id");

var profile = profiles[0].up(1).immediateDescendants();

Cookie.set("test", 'FirstName='+profile[2].innerHTML
+'&LastName='+profile[3].innerHTML, 1);

alert(Cookie.get("test"));
-------------------------------------


It works fine. But I am trying to loop through an array, and build a
listener.

Any ideas?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to