I've got problem with the Selectors API.
I want to find an element:

<input type="hidden" name="a_b[c]">

All I know about it, is that this element lays inside some div with
id="container", and it is not the only one hidden-type input in it.

So I've tried to use the following call:
> $$('#container input[type=hidden][name="a_b[c]"]')
Unfortunately, it doesn't work - finds nothing.

I think, the problem may be, because of the square brackets sings used
in name' value. I've tried to escape them using backslash - it doesn't
work.

In further investigations I've managed to find it using the following
call:
> $$('#container input[type=hidden][name^="a_b[c"]')
This one works as expected. But what if there will be another input
with name="a_b[cd]"? I don't know what will be the names of inputs,
because it's list is generated by server-side script.

I am able to workaround this, i.e. finding all the inputs of type
hidden, then iterate through them and find the one with the id I'm
looking for (using Enumerable.find()).

But what am I curious about is where the bug lies:
Is there some way I can escape the closing square bracket sign?
Is it some Prototype's selectors' engine bug? Bad parsing rules?
Maybe some browser bug?

I am using Internet Explorer 6 under Win XP pro.

Thanks in advance, for any replies :-)


--~--~---------~--~----~------------~-------~--~----~
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