#12221 closed bug (cantfix)
form is not being hidden when it have an input with name attr value set as "style"
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | low | Milestone: | None |
Component: | effects | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
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 (6)
comment:1 Changed 10 years ago by
comment:2 Changed 10 years ago by
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 10 years ago by
Component: | unfiled → effects |
---|---|
Priority: | undecided → low |
Status: | new → open |
I'm inclined to say wontfix here. Let's see what the core team thinks.
comment:4 Changed 10 years ago by
Resolution: | → cantfix |
---|---|
Status: | open → closed |
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 10 years ago by
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.
Here is a jsFiddle with some tests: http://jsfiddle.net/davidbuzatto/7P2AL/