Required fields in bold or with *

0
Hi, what is the easiest way to indicate for a user that a field is required? One option is to set "font-weight: bold;" in style. Can a * be added automatically when a field is set "required"? Are there other options? Is there a way to define the style of a label of a required field once in the CSS, and let the CSS find out when to apply it? How? Can the text box property "required" trigger a specific style? Any other suggestions? BTW: I have validations implemented that enforce required values in fields: that is not the problem. I want to indicate to the user that certain fields are required, to prevent that he gets annoying validation messages.
asked
4 answers
1

For US Section 508 compliance, you should not use visual cues like bold typeface for this. Instead, use a naming convention, like adding ' *' to the end of all required fields labels.

answered
2

Did anything change regarding this in Mendix since 5 years? Or is the best practise still to simply add a "*" for every field which is required :)?

answered
2

It would be nice if Mendix added a class for the required fields. 

An option that works is adding a (custom) class to the field. for example: mandatory

Add some css to the custom.css:

.mandatory label.control-label::after {
    content: " *";
}

All fields where you enter the class mandatory will get an * added to the label. 

answered
0

You could use the 'place holder' attribute.  I like to set it to 'required'.

 

answered