You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Disable the button upon form submission, if possible. Maybe there could be a special bootstrap tag to add to the button such as "data-bs-disable-on-submit" and it would only work if the button is inside a form.
Motivation and context
When submitting a form with a button, I noticed that there is nothing preventing the user from continuously pressing the same button, which could cause issues from the multiple form submissions. Admittedly, this is not a huge issue, as one could probably catch the form submission event with javascript and disable the button, but it would still be a decent feature to add for developers such as myself that try to keep their code as clean and simple as possible by using all the available Bootstrap tags and classes to limit the amount of extra javascript or css needed.
The text was updated successfully, but these errors were encountered:
Thanks for the suggestion! I'll let other maintainers share their thoughts, but I believe this behavior falls outside the scope of Bootstrap. It's aligned with the default behavior of native HTML forms, and Bootstrap's role is generally focused on providing minimal JavaScript enhancements.
This specific use case can be addressed quite easily on the client side by listening for the submit event, identifying the button, and applying the disabled state as needed. While it’s a valid concern, managing form submission logic is typically left to the application layer rather than the framework itself.
Prerequisites
Proposal
When a button has a type of "submit" and is inside a form like such:
Disable the button upon form submission, if possible. Maybe there could be a special bootstrap tag to add to the button such as "data-bs-disable-on-submit" and it would only work if the button is inside a form.
Motivation and context
When submitting a form with a button, I noticed that there is nothing preventing the user from continuously pressing the same button, which could cause issues from the multiple form submissions. Admittedly, this is not a huge issue, as one could probably catch the form submission event with javascript and disable the button, but it would still be a decent feature to add for developers such as myself that try to keep their code as clean and simple as possible by using all the available Bootstrap tags and classes to limit the amount of extra javascript or css needed.
The text was updated successfully, but these errors were encountered: