Closed ontehfritz closed 13 years ago
used a simple fix with jquery: $('form').submit(function(){ $('input[type=submit]', this).attr('disabled', 'disabled'); });
added to the layout template. so it is applied to all submit buttons. Yes, it won't work if javascript is disabled, however the application won't work either, LOL. You need to have javascript enabled.
$('form').submit(function(){ $('input[type=submit]', this).attr('disabled', 'disabled'); });
Has an issue, forms using multiple buttons contain the name of the button in the ":commit" parameter. This is not submitted when using the above javascript. There is not way to tell what operation you want to execute. Some solutions involve setting a hidden value that contains the action you want to perform. I might try this! This issue is officially reopened!!! AHHHH!!!
found a great way to handle double submits, however it still relies on javascript ... but once again what doesn't, it is very simple and built into rails which is great!
<%= f.submit "Create", :disable_with => 'Creating ...' %>
When creating surveys, sections, etc ... a user can click the submit button multiple times creating duplicate items