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

219
Views
JQuery AutoComplete, manually trigger select callback with custom data

There is a way i can manually trigger the select and pass custom data into it? I look into this question, but this just automate the ui and click on the dropdown item. My jQuery autocomplete initialization is look like this:

$("#id_full_name").autocomplete({
    source: "/messages/fax/contact_autocomplete/",
    minLength: 1,
    focus: function(event, ui) {
        event.preventDefault();
    },
    select: function(event, data) {
        if (true) {
            /* Do something */
        } else {
            /* Do something */
        };
    }
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Just declare an actual function and call the function as needed:

function select(event, data) {
  // ... whatever code
}
$("#id_full_name").autocomplete({
    source: "/messages/fax/contact_autocomplete/",
    minLength: 1,
    focus: function(event, ui) {
        event.preventDefault();
    },
    select: select
});
select(null, "custom data");
about 4 years ago · Juan Pablo Isaza Report
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!