How to display Required field with Red Asterick sign

0
Hello All, In my pages I want to display all the mandatory/required fields with Red Asterick Sign after the field label. But as the field are directly mapped from an entity it does not allow to add any new extra * label in between.    
asked
3 answers
5

I'd use some CSS to add the *. Add a class like 'starlabel' to your input field and in the .scss files in your theme folder add something like this:

.starlabel label:after {
  content:" *";
  color: red;
}

This way you don't need to rearrange your pages using tables and what not.

answered
-1

Hi 

You can add one more text in the top and in the caption use * and style as red

answered
-1

You can add a red asterisk after the field label in few ways. The exact approach depends on the orientation of Controls on your form. If the labels and controls are vertically stacked then you can simply use the solution suggested by Joseph. However, if the labels and controls are horizontally stacked then you would need a table or a layout grid of 2 columns. The first column will contain labels and asterisk and the second column will contain your controls. So, here are the steps that you can follow:

Step 1: Add a table with 2 columns
Step 2: Add two labels in the first column, the first label would take the desired caption and the second label would contain asterisk.
Step 3: Open the properties of the second label and add "color:red; font-weight:bold" in the style text area under Appearances Tab.
Step 4: Add the required Control in the second column
Step 5: Open Properties of the Control added in Step-4 and set "Show Label" setting to No
Step 6: Go to the Appearance Tab and set Align property to left for this control

Step 7: The final result will look like the below form

Step 8: The final result will look like the below form

answered