How do you style an input field as required #4050
-
I was looking at the DaisyUI docs on how to mark an input field as required (or a style automatically applied when the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
We don't force such style automatically, because there are different approaches in form design:
It depends on the form: So we don't set a style automatically based on existence of Let me know if you have a question. |
Beta Was this translation helpful? Give feedback.
We don't force such style automatically, because there are different approaches in form design:
It depends on the form:
For example if you have 10 inputs and 9 of them are required, you wouldn't want to show
required
badge or a red asterisk next to 9 of them. Instead you would want to writeOptional
in front of one input.If you have 10 inputs and one is required, you would want to show a
required
badge or a red asterisk next to that one input.So we don't set a style automatically based on existence of
required
attribute.Here a…