This project is archived and is in readonly mode.

#708 ✓duplicate

Input fails to set name in IE6

Reported by DarkPilgrim | July 9th, 2009 @ 09:21 AM | in 1.3.0 rc2 (closed)

If you code like below:

 var input = new Element('input');
 input.set('type', 'text').set('name', 'some').set('value', '123');
You'll find name is not set in IE6. Although this could be done by setting name on construction:
var input = new Element('input', { name: 'some'} );
I think this may be a bug. Please check.

Comments and changes to this ticket

  • Fábio M. Costa

    Fábio M. Costa August 1st, 2009 @ 11:03 PM

    Confirmed. It doenst work on ie6 and ie7.

    The problem is that input.getAttribute('name', 2) is returning an empty string.

    Both input.getAttribute('name') and work fine, as seen on link:

    I tested on safari4, opera 9.6, firefox 3.5, ie8, just ie6 and ie7 have the bug.

  • Scott Kyle

    Scott Kyle August 4th, 2009 @ 05:18 PM

    • Assigned user set to “Valerio”
    • Tag set to element.get

    Looks like IE has a bug when using the return-as-string iFlag on the 'name' attribute. This flag is only used to force the return value to a string, including returning no attribute (null) as an empty string. We might have to not use that flag and do our own conversion to a string:

    var attr = this.getAttribute(attribute);
    return (attr == null) ? '' : '' + attr;
  • Scott Kyle

    Scott Kyle August 5th, 2009 @ 06:09 AM

    MooTools 2 is safe from this problem, because for 'name' and many others, calling el.get('name') returns, not el.getAttribute('name', 2).

  • Scott Kyle

    Scott Kyle September 4th, 2009 @ 03:34 AM

    • Assigned user changed from “Valerio” to “Scott Kyle”
    • State changed from “new” to “open”
  • Fábio M. Costa

    Fábio M. Costa April 2nd, 2010 @ 04:51 AM

    • State changed from “open” to “duplicate”
    • Milestone changed from 2.0 to 1.3.0 rc2

    setting as duplicate from #747. This is likely to be fixed at 1.3.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

Referenced by