Skip to Content

How to add asterik to form element label

Hello Friends ,

I have created below UI fields . I want to add * before form element label which is currently not appearing . Could you please explain me how can I add those ?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    May 13, 2017 at 06:56 AM

    I solved it myself by changing CSS color from blue to red

    Add comment
    10|10000 characters needed characters exceeded

  • May 03, 2017 at 04:08 AM

    use "required" property of label, i.e. required="true"

    Add comment
    10|10000 characters needed characters exceeded

  • May 09, 2017 at 10:53 AM

    Thanks Akhilesh ... Asterik is currently blue how do I change this to red ?

    Add comment
    10|10000 characters needed characters exceeded

    • Include below style in your css file:

      .sapMLabelRequired:before { content: "*"; color: red; font-size: 1rem; line-height: 0.9375rem; }

      This applies to all fields which are required.

      Thanks

      Dheeram