Placeholder in place of label

Placeholder in place of label

klermannklermann Posts: 277Questions: 67Answers: 1

Where can I edit the modal and inputs, to remove the label and placeholder?

This question has an accepted answers - jump to answer

Answers

  • bindridbindrid Posts: 730Questions: 0Answers: 119
    edited July 2017

    try this:
    http://live.datatables.net/hilileto/1/edit

    $(document).ready( function () {
      $("#example").one("preInit.dt", function(){
        
        var filterbox = $(".dataTables_filter");
        var searchbox = fil.children();
        $(search.contents()[0]).remove();
        fil.find("input").attr("placeholder", "Search");
    
      });
      var table = $('#example').DataTable();
    });
    
  • klermannklermann Posts: 277Questions: 67Answers: 1

    I think you do not understand. That's not what I meant.
    I'm using the datatable editor and I want to put a label inside the fields, (placeholder), I want to assign the labels inside the inputs

  • rduncecbrduncecb Posts: 125Questions: 2Answers: 28
    edited July 2017

    I've not played with removing the labels from editor fields but you can add placeholders via the field definitions in your editor config. Check the field type docs for exact usage as I don't believe it's the same for all field types (for example, HTML5 select inputs don't allow placeholders but the Editor field type implements options to simulate one).

    For example, the text field type refers to a placeholder: https://editor.datatables.net/reference/field/text

    Removing the label is probably as simple as setting label: '' in the field definition.

  • allanallan Posts: 63,179Questions: 1Answers: 10,410 Site admin
    Answer ✓

    In combination with the placeholder attribute @rduncecb mentions, you can also use CSS to hide the label elements: div.DTE_Field label { display: none; }. You might need to adjust the other CSS to account for this, depending on exactly what you want.

    Allan

This discussion has been closed.