-
Notifications
You must be signed in to change notification settings - Fork 263
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
Add form submit attributes (like formaction
) to buttons
#177
Comments
Adding actions and maybe other attributes to buttons would be cool. I'm also thinking of simplifying the widgets to templates, or perhaps dropping button support entirely, since it's often easier to just code the buttons manually. Feel free to discuss a solution or even to submit a PR. |
I already made #178 back then! It's not a very inspired solution, though, just more parameters for buttons. Buttons are handled differently from fields in forms.py right now - fields take attributes as I did something similar for In this PR, I also make using data attributes possible by converting attributes starting with Supporting data attributes would probably be a good idea anyway? In any case, I think that making buttons less restrictive would be awesome and better than dropping support for them - less restrictions to work around would also mean that they are easier to use. Let me know what you think, I'd definitely consider doing what I just suggested if you agree that it's a good idea (although unfortunately, to be completely honest, I can't really promise anything - many small jobs that all need to be done from home with few boundaries might make that difficult). |
I came across this same problem in django-bootstrap5. Buttons need more options. Thanks for your patience on this. |
I think this is what you mean (in django-bootstrap5): Note that this does not cover data attributes, we'll cover that in a separate issue. |
See also: https://caniuse.com/#feat=form-submit-attributes
This would be awesome considering that
form
elements are not allowed to be nested. For constructing a formset with some buttons that do something with individual objects (move up/down, delete, ...) there are currently no good options.bootstrap_button
tag. But it would still be nice not to have to do that.If this is considered a worthwhile addition, I'm prepared to implement it.
The text was updated successfully, but these errors were encountered: