Conversation
data-disabled-with because it will not submit your forms in ie7.
have that functionality
you press enter instead of clicking the button
|
I also added another fix in my fork that will fix an issue in ie where you press "ENTER" on an input. Without the fix it didn't want to submit the form. IE has some weird event calling when you press enter:
It's really weird and because i implemented the double submit it didn't want to proceed, hence the fix. |
|
I don't think I'll pull this. Regarding "required" fields: if you can put together feature detection that only enables this behavior in browsers that don't submit forms with missing values (i.e. Opera for now), I would gladly disable it for other browsers. However, since such feature detection doesn't seem possible, I have to enable it in all browsers. Yes, this means that remote forms will not be sent over Ajax if required values are missing. As for regular forms, they're left intact. Regarding disabling form buttons and IE: this is an IE bug that I need to work around. I don't think a good workaround is implementing this feature the way you did. First, you completely disabled the possibility that any form could be submitted more than once, forgetting that some use-cases might required "remote" forms to be submitted multiple times (with users possibly entering different values each time, like a live chat message. Second, unlike the disabled submit buttons, your solution doesn't provide any UI hint that the button is inactive. A disabled submit button is grayed out by default and can be further styled with CSS to communicate "this is not clickable". I think I have a simple solution for IE and disabling buttons, but I could never write a proper test because jQuery has a bug with triggering form submit via button click (it doesn't emulate it correctly). |
|
Thnx for the reply :) About the form submission, i left the part out where you enable the form again by default. In the ajax:complete you could enable your form again by set form.submitted to false. I know this solution is not immediately clear but in our case we don't want double submissions. I understand that removing disable is not the best solution ever but it really prevented use from submitting the form in ie (it just didn't work). I look forward to other solutions for the problems we encountered and this was my own solution for the problems we had. |
|
If anyone comes across this (googling or whatever), I added the IE ENTER button problem to the Wiki with a solution. |
Hey,
First of all i want to inform that i don't have created tests for the changes i made but i will try to if i understand how it works.
The pull request contains 2 fixes i encountered while using rails.js.
If you use the data-disable-with functionality that will display a loading message on a button if you submit a form you have to know that there is an issue with this in ie7. Because in ie when you disabled a button it won't fire the submit event anymore causing not form to submit at all. That why i removed setting the disabled attribute and implemented a global submitted value on the form which will also prevent pressing the button twice what disabled also does.
As far of the required fields i don't think it's a good idea to enable this by default because one might assume you don't want it. I think the default should be that it's disabled.
Would like to have feedback if the above comments are not valid.
thnx