Found some kind of a bug. I think that $$("select") should return at
least all the elements except $("length") instead of returning an
empty array.
#########################
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/
TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml";>
<head>
<meta content="text/html; charset=windows-1251" http-equiv="Content-
Type" />
<link href="templates/css/css.inc.css" rel="stylesheet" type="text/
css" />
<script src="prototype.js" type="text/javascript"></script>
<script>
Event.observe(window,"load",function()
{
        selects1=$$("select");
        alert(selects1.size());
        // This will give us an empty array! Need a workaround.
        selects2=document.getElementsByTagName("select");
        for(id in selects2)
        {
                alert(id);
        }
        // This will give us an array with 2 "length" keys.
});
</script>
</head>

<body>
<form>
<select name="length" id="length"></select>
<select name="any" id="any"></select>
</form>
</body>
</html>
#########################
--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-spinoffs@googlegroups.com
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