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.

Rails 3 and jQuery disable_with problem in IE 7 and below

#6135

Am using the latest rails-ujs and jQuery v 1.4.4. Have experienced the following problem in IE7 and 6. I don't have access to IE8 or above to hand so haven't tested in those browsers - but certainly no problems in any other browser I've tested (all modern browsers).

Steps to reproduce:
Create a form using the :disable_with attribute, view the form in IE7 and click the submit button.

Expected behaviour:
The value of the submit button should be replaced with the disable_with value, the button should be disabled and the form should submit.

Actual behaviour:
The form fails to submit - so the value of the form is changed, the button is disabled, but then nothing...

Additional info:
I'm not sure if this is a Rails bug or a jQuery bug, but am posting it here as it affects Rails functionality. The problem seemed to be party due to the usage of the jQuery live() method to attach the function to the event. A workaround I have used is to unbind the function and re-bind it using plain old bind().

/* Hacky fix */
$(disable_with_form_not_remote_selector).die('submit.rails', disable_with_input_function);
$(disable_with_form_not_remote_selector).bind('submit.rails', disable_with_input_function);

Reported by Aaron Russell · December 8th, 2010 @ 09:34 PM

State: duplicate
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Neeraj Singh
    Neeraj Singh
    • State changed from new to duplicate
    • Importance changed from to Low

    December 8th, 2010 @ 10:19 PM