Dhibi_Mohanned
Dhibi_Mohanned

Reputation: 313

Problems with the jquery plugin Tokeninput

I use the jquery plugin Tokeninput that allow autocomplete in textBox. I would prevent user from selecting duplicate words inn the dropdown of autocomplete.

Does anybody have any suggestion to resolve this problem?

Thanks a lot in advance.

Upvotes: 0

Views: 632

Answers (1)

Pete
Pete

Reputation: 133

It looks like there is a setting for preventDuplicates which prevents user from selecting duplicate values by setting this to true. The default is false, you would want to set the to true.

    $(document).ready(function() {
        $("#demo-input").tokenInput("path/to/list", {
            preventDuplicates: true
        });
    });

You can also see the demo here: http://loopj.com/jquery-tokeninput/demo.html#prevent-duplicates. Hope this helps

Upvotes: 2

Related Questions