Replies: 2 comments 2 replies
-
You mean field name? Yes there is a way, this example uses different CSS classes for each field: Here I pass
to the Bootstrap form renderer. Other frameworks use other classes. This is documented here: https://django-formset.fly.dev/form-renderer/ |
Beta Was this translation helpful? Give feedback.
-
Actually, I do mean "value". What I would like to do (for one example) is change the color of the text based on whether or not it is negative, so while the default color (I've used the css_classes you mentioned) might be green or black, I want it to be red if the value (dollar amount) is negative. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a preferred way to style/add a class to a field based on that field's value? I know I could create widgets for each one, but that becomes tedious.
Beta Was this translation helpful? Give feedback.
All reactions