Ticket #4588 (closed bug: duplicate)
Form element with input element named "action" makes the form unselectable
| Reported by: | silfreed | Owned by: | john |
|---|---|---|---|
| Priority: | major | Milestone: | 1.4 |
| Component: | selector | Version: | 1.3.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
In the attached example, I can't select the form through any method(jQuery('#mozdev-add-image-dialog').children('form'), jQuery('#mozdev-add-image-dialog').find('form'), jQuery('#mozdev-add-image-form'), jQuery('form')), and even trying to select the form's siblings or the form parent's children seems to fail (doesn't return - ex: jQuery('#mozdev-add-image-dialog').children()). If I change the input element inside the form named "action" to anything other than "action" the form becomes selectable.
Attachments
Change History
Changed 3 years ago by silfreed
-
attachment
form-unselectable.html
added
comment:1 Changed 3 years ago by dmethvin
- Status changed from new to closed
- Resolution set to duplicate
Because of the way DOM1 properties of form elements work, it is not a good idea to give input elements any name that is also a property of the form (e.g., length, action, method, enctype, target). There are several long-standing tickets open about this including #3113 and #4039. I don't know if jQuery can easily fix this but in any case I'll close this ticket as a duplicate.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Example html file where form is unselectable