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.

This project is archived and is in readonly mode.

FormTagHelper#submit_tag outputs invalid Javascript for IE

#2437

It looks like the submit tag recently got an update to preserve the value of the commit attribute when using the disable_with option. The new behavior works fine in FFox and Safari but breaks in IE due to a limitation in the IE DOM which only allows you set an element's type property once. This restriction doesn't work with cloneNode which sets the type property based on the node you're cloning.

The fix uses createElement to achieve a similar effect to cloneNode.

Patch is attached.

Here's a blog reference (not mine): http://bit.ly/lu873. See the section called "And your type attribute too."

Reported by Chris O'Meara · April 7th, 2009 @ 03:18 AM

State: resolved
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. CancelProfileIsBroken
    CancelProfileIsBroken
    • Tag changed from clonenode, form_tag_helper, javascript, patch, submit_tag to bugmash, clonenode, form_tag_helper, javascript, patch, submit_tag

    August 6th, 2009 @ 01:28 PM

  2. Rizwan Reza
    Rizwan Reza

    -1 The patch doesn't apply neither to 2-3-stable nor master.

    August 8th, 2009 @ 04:52 PM

  3. Tim Caswell
    Tim Caswell

    There was a commit last March that fixes the IE problem. That's why this patch doesn't apply cleanly.

    http://github.com/rails/rails/commit/9537fd0e3a7625afe4bee75d749647...

    August 8th, 2009 @ 10:35 PM

  4. CancelProfileIsBroken
    CancelProfileIsBroken
    • Tag changed from bugmash, clonenode, form_tag_helper, javascript, patch, submit_tag to clonenode, form_tag_helper, javascript, patch, submit_tag
    • State changed from new to resolved

    August 9th, 2009 @ 03:13 AM