Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

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

#475

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?

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

State: resolved
Milestone: none
Assigned to: MadRabbit MadRabbit

Activity

  1. MadRabbit
    MadRabbit

    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

    October 17th, 2011 @ 01:19 PM

  2. CjK
    CjK

    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?

    October 17th, 2011 @ 01:34 PM

  3. MadRabbit
    MadRabbit

    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

    October 17th, 2011 @ 01:57 PM

  4. CjK
    CjK

    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.

    October 17th, 2011 @ 02:56 PM

  5. MadRabbit
    MadRabbit
    • 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

    November 5th, 2011 @ 03:18 PM

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.