Nexz
Nexz

Reputation: 93

disable Javascript auto suggest function for some word

I has only one question about JavaScript. can we disable auto suggest function for only certain word? I mean, if User typing some word such as "plate" then auto suggest function will not return any value but if they typing other than that, the function will work as it mean to.

Upvotes: 0

Views: 60

Answers (1)

Amir H. Bagheri
Amir H. Bagheri

Reputation: 1416

You should have an event listener added to your textbox like following:

 $('#mytextbox').keyup(function(e){
    if ($(this).val().match(/^plate$/))
    {
      return;

    }
    // proceed your autocomplete here
 });

Upvotes: 1

Related Questions