Ticket #12221 (closed bug: cantfix)
form is not being hidden when it have an input with name attr value set as "style"
| Reported by: | davidbuzatto@… | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | None |
| Component: | effects | Version: | 1.7.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Using this:
$(function(){
$("form").hide();
});
The code above works for this:
<form>
<input id="foo" name="bar"/>
</form>
But not works for this:
<form>
<input id="foo" name="style"/>
</form>
Change History
comment:2 Changed 9 months ago by anonymous
this is spawned by http://stackoverflow.com/questions/11864899/hiding-form-tag-in-jquery
the behaviour can be reproduced by setting either id or name to "style"
comment:3 Changed 9 months ago by timmywil
- Priority changed from undecided to low
- Status changed from new to open
- Component changed from unfiled to effects
I'm inclined to say wontfix here. Let's see what the core team thinks.
comment:4 Changed 9 months ago by gnarf
- Status changed from open to closed
- Resolution set to cantfix
I'm pretty sure this is a "cantfix" not a "wontfix" - it is eerily similar to #1414 which rick and I spent a lot of time trying to find a nice way around... Either way, this is a DOM Lint issue http://kangax.github.com/domlint/ test #1
Names of form controls are populated as properties of "parent" form element and might conflict with "actual" properties of a form element (either own or inherited via "interface chain") Interfaces tested against are HTMLFormElement, HTMLElement, Element, Node, EventTarget, ElementCSSInlineStyle as well as Object.prototype
comment:5 Changed 9 months ago by dmethvin
Yeah I agree, sometimes we can work around these but I don't think so in this case--especially in IE6/7. Also it's not a jQuery-specific issue and there's no obvious place that the jQuery docs can mention this. Web devs just have to know that some words cannot be used as form names. Sucks.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Here is a jsFiddle with some tests: http://jsfiddle.net/davidbuzatto/7P2AL/