Modify ↓
Ticket #1290 (closed bug: worksforme)
long id cannot be adressed via jquery
| Reported by: | fpauser | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 1.1.4 |
| Component: | core | Version: | 1.1.3 |
| Keywords: | id, selector | Cc: | |
| Blocking: | Blocked by: |
Description
hi,
i get this textarea:
<textarea name="record[_customer_Produkte][97678][Anwendungsgebiete][value]" id="record[_customer_Produkte][97678][Anwendungsgebiete][value]">bla bla</textarea>
trying to do: $('#record[_customer_Produkte][97678][Anwendungsgebiete][value]')
returns an empty array - document.getElementById('record[_customer_Produkte][97678][Anwendungsgebiete][value]') works! (ubuntu feisty, ff-2.0.0.4)
not tested in ie!
greets,
fpauser
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

In order to make that work you'll have to do:
$('#record\\[_customer_Produkte\\]\\[97678\\]\\[Anwendungsgebiete\\]\\[value\\]')Of course, at that point it's probably better to just generate a different ID.
More information can be found here: http://docs.jquery.com/Frequently_Asked_Questions#How_do_I_select_an_element_that_has_weird_characters_in_it.27s_ID.3F