-1

How to customize token result format dropdwon without starting with li tag? text1

  • list1
  • list1
  • list1
  • list1
  • text2
  • list2
  • list2
  • list2
  • list2
  • Mike Poole
    • 1,958
    • 5
    • 29
    • 41

    1 Answers1

    0

    Use the resultsFormatter property.

    The default is:

    function(item){ return "<li>" + item.propertyToSearch + "</li>" }
    

    You can change this to whatever you want, e.g.

    $(document).ready(function () {
        $("#my-text-input").tokenInput("/url/to/your/script/", {
            resultsFormatter: function(item) {
                return "<p>" + item.propertyToSearch + "</p>"
            }
        });
    });
    
    Chris
    • 5,882
    • 2
    • 32
    • 57