Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

226
Views
typeahead.js with multiselect extension: how do I set a default selection?

I have an app with jQuery typeahead and the typeahead multiselect extension.

On load I would like certain elements to be selected by default, how do I do that?

$(document).ready(function() {
  waitingDialog.hide();
  
  $("#typeahead").typeaheadmulti({
    minLength: 1,
    hint: false,
    highlight: true,
    autocomplete: false,
  }, {
    name: 'Typeahead',
    source: function(query, syncResults, process) {
      var args = {};
      args.Str = query;
      gers = aj("Search", function(res) {
        names = [];
        ids = {};
        res.d = JSON.parse(res.d);
        $.each(res.d,
          function(i, lkp) {
            names.push(lkp.name.trim().toUpperCase());
          });
        process(names);
      }, JSON.stringify(args), null);
    },
    limit: 10
  })
});
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!