1
$("#tags").autocomplete(["c++", "java", "php", "coldfusion", "javascript", "asp"], {
width: 320,
max: 4,
highlight: false,
multiple: true,
multipleSeparator: " ",
scroll: true,
scrollHeight: 300
});
)};

I am trying to use Jquery UI autocomplete with multipleSeparator. Which means that I can pass a string array as { " AND ", " OR " } and when someone will type like:

C++ and Java and p

the php will come.

So basically I am trying to make a logical operator based expression.

Looking for Candidate: C# or C++ and ASP

I need intelli sense in C# as well as in C++ but not in or , and.

Please help how can I amend?

1 Answer 1

2

I managed to get that through:

 $.ajax({
     url: sourceUrl,
     dataType: "json",
     type: "POST",
     cache: true,
     data: {
          text: fnGetTerm(request, autoCompleteSeparator) 
     },

where fnGetTerm is written as:

function fnGetTerm(request, autoCompleteSeparator) {
    var startsWith = null;
    if (autoCompleteSeparator == undefined || autoCompleteSeparator == null || autoCompleteSeparator.length == 0) {
        startsWith = request.term
    }
    else {
        startsWith = fnAutoCompleteExtractLast(request.term, autoCompleteSeparator);
    }

    return $.trim(startsWith);
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.