#475 ✓resolved
CjK

Can't create button-element using $E in IE8

Reported by CjK | October 17th, 2011 @ 01:08 PM

This works in IE8 (and other browsers):

var b = $E('input', {name: 'commit', type: 'submit', value: 'bla'});

This fails in IE8 (but works in other browsers):

var b = $E('button', {name: 'commit', type: 'submit', value: 'bla'});

--> "Object or Property is not supported"

However, I can create a button-Element using document.createElement('button') and setting it's attributes in IE8.
That's why I suspect this might be a RightJS-Problem?

Comments and changes to this ticket

  • MadRabbit

    MadRabbit October 17th, 2011 @ 01:19 PM

    Hi Claus,

    Yup, that might be a rightjs problem. people normally don't use BUTTON tags, coz they send different form values in IE and w3c (IE sends the text inside of the tags and w3c send the value attribute), so it probably wasn't noticed before.

    I'll check it out shortly

  • CjK

    CjK October 17th, 2011 @ 01:34 PM

    Looks like setting the "type"-Attribute actually causes the error:

    b = $E('button');
    b.set('type', 'foo');
    --> ERROR

    however:

    b._.setAttribute('type', 'submit');
    ---> WORKS

    b.get('type');
    --> "submit"

    So, is perhaps the element#set method doing something that IE doesn't like?

  • MadRabbit

    MadRabbit October 17th, 2011 @ 01:57 PM

    btw, did you check what your form actually sends to the server in IE? there is a similar issue with checkboxes, when you create a checkbox programmatically in IE and set the 'checked' value, it seems working correctly in JavaScript debugging but the browser doesn't send anything to the server in reality

  • CjK

    CjK October 17th, 2011 @ 02:56 PM

    Nik, thanks for pointing this out. I've checked and the button seems to work fine in IE.

    I've had so many surprises with IE-browsers that a "it works" makes me suspicious :-}

    In my case, a simple workaround would be to leave the "type: 'submit'" Attribute out when creating the button, since it's the default-value for buttons. But this doesn't solve the general issue.

  • MadRabbit

    MadRabbit November 5th, 2011 @ 03:18 PM

    • State changed from “new” to “resolved”

    Hi Claus,

    I've fixed the bug https://github.com/rightjs/rightjs-core/commit/36131b7827fa2322910a...

    Will be published with the 2.3.0 release, probably tomorrow

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

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

RightJS Core Tickets

Shared Ticket Bins

People watching this ticket

Tags

Pages