Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jl - Disabling submit button to prevent multiple form submissions #275

Merged
merged 1 commit into from Feb 26, 2018

Conversation

jleonardw9
Copy link
Collaborator


$(document).on 'click', '.add_fulfillment', ->
$('.add_fulfillment').prop('disabled', true)
$('.fulfillment-form').submit()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need this? Won't it continue down the normal submit path?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it will still submit the form. But disabling the button prevents the user from creating multiple fulfillments. Before you could rapid click and create like 6 of them.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried just disabling the button without the $('.fulfillment-form').submit(), but the form would not submit in that case. I needed to do the manual submit after the disable.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, sounds good.

@amcates amcates merged commit 063246d into master Feb 26, 2018
@amcates amcates deleted the jl-disable-multiple-form-submissions branch February 26, 2018 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants