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);