How to add red star (*) marker after or before the field label for the required field ?

How to add red star (*) marker after or before the field label for the required field ?

NickZhangNickZhang Posts: 11Questions: 7Answers: 0
edited August 2015 in DataTables 1.10

How to add red star (*) marker after or before the field label for the required field ?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Answer ✓

    Two options:

    1. Use the fields.label option for the field in question and simply add something like <i class="required">*</i> to the string.
    2. Add a class to the field such as required using fields.className and then use a little bit of CSS to add a :before or :after pseudo element with a content: '*' for the label.

    Allan

  • NickZhangNickZhang Posts: 11Questions: 7Answers: 0

    Thanks ,

    have added below css to achieve

    div.required >label:before {
    content: "* ";
    color: red;
    }

This discussion has been closed.