Datatables Editor - Custom color for select placeholder (value empty '')

Datatables Editor - Custom color for select placeholder (value empty '')

CapamaniaCapamania Posts: 233Questions: 81Answers: 5
edited May 20 in Editor

I would like to style the placeholder of a select (default value empty '') (https://editor.datatables.net/examples/simple/fieldTypes.html) a bit different than when a value is selected.

I've tried so far:

CSS:

    .DTE_Field_InputControl select::placeholder {
      color: #999;
    }
    /*
    .DTE_Field select::placeholder {
      color: #999;
    }
    */
    /*
    .DTE_Field select[placeholder="Select"] {
      color: #999
    }
    */
    /*
    .DTE_Field select option:disabled {
      color: #999
    }
    */

HTML:

    <select id="DTE_Field_groups-status" class="form-control">
        <option value="" hidden="" disabled="">Select</option>
        <option value="0">Inactive</option>
        <option value="1">Active</option>
    </select>

Any idea how to accomplish this?

Answers

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

    I'm not sure that is possible with CSS I'm sorry to say. The select element can be really hard to style - the browser's are quite limited in what they can do with it, and assigning a specific colour to a specific option is one of the limitation I think.

    Allan

Sign In or Register to comment.