Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom input is not working in jQuery Token input plugin

$("#responsible").tokenInput(
            [
                {id: 7, name: "[email protected]"},
                {id: 11, name: "[email protected]"},
                {id: 13, name: "[email protected]"},
                {id: 17, name: "[email protected]"},
                {id: 19, name: "[email protected]"},
                {id: 23, name: "[email protected]"},
                {id: 29, name: "[email protected]"},
                {id: 31, name: "[email protected]"}
            ],{
                prePopulate: respArray,
                hintText: "Enter mailid",
                allowCustomEntry: true,
                theme : "facebook",
               noResultsText: "O noes",
                searchingText: "Searching...",
                minChars: 1,
                tokenLimit: 1,
                tokenValue: "name",
                preventDuplicates: true
            }
);
  1. Token input is not working for custom entry. As soon as the cursor is out from the input, text will be disappeared from the input. How can i solve this problem.
like image 344
Shri Avatar asked Oct 21 '22 07:10

Shri


1 Answers

Test with @Cindrella:

$("#responsible").tokenInput(
        [
            {id: 7, name: "[email protected]"},
            {id: 11, name: "[email protected]"},
            {id: 13, name: "[email protected]"},
            {id: 17, name: "[email protected]"},
            {id: 19, name: "[email protected]"},
            {id: 23, name: "[email protected]"},
            {id: 29, name: "[email protected]"},
            {id: 31, name: "[email protected]"}
        ],{
            prePopulate: respArray,
            hintText: "Enter mailid",
            allowCustomEntry: true,
            theme : "facebook",
            noResultsText: "O noes",
            searchingText: "Searching...",
            minChars: 1,
            tokenLimit: 1,
            tokenValue: "name",
            allowFreeTagging: false,  // !ADD THIS !
            preventDuplicates: true
        }
);
like image 66
justjavac Avatar answered Oct 27 '22 11:10

justjavac