Bug Tracker

Opened 7 years ago

Closed 7 years ago

Last modified 5 years ago

#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:
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 7 years ago by David Buzatto <davidbuzatto@…>

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

comment:2 Changed 7 years 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 7 years ago by timmywil

Component: unfiledeffects
Priority: undecidedlow
Status: newopen

I'm inclined to say wontfix here. Let's see what the core team thinks.

comment:4 Changed 7 years ago by gnarf

Resolution: cantfix
Status: openclosed

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 

Version 0, edited 7 years ago by gnarf (next)

comment:5 Changed 7 years 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.

comment:6 Changed 5 years ago by dmethvin

#15120 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.