data-disable-with re-enables otherwise-disabled fields
I have a wizard-style form that the user submits three times; each time, a different part of the form is enabled. jquery-ujs currently re-enables every field tagged with data-disable-with, regardless of whether it was previously disabled. Could it instead save the state of the disabled attribute and restore it later?
(I can work around this by splitting the wizard into three separate forms, or adding data-disable-with on the fly instead of statically in the view, but I'm thinking about The Future.)
This could probably be done without too much difficulty.
Question: if an input is already disabled, do we want to re-disable it with the data-disable-with text and then return it to it's original text (still disabled)? Or do we want to simply skip the data-disable-with text if it's already disabled?
Hmm.. for my use case it doesn't matter, since they're actually images and thus the disabling text doesn't appear. If I had to guess at another use case, I'd say don't re-disable it, because you'd be changing the text of an element that's (at the moment) not really part of the form. But I think either way is fine till someone else wants it a different way :)