Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 979403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:12:51+00:00 2026-05-16T04:12:51+00:00

I am trying to get an autocomplete working and making an Ajax form submission

  • 0

I am trying to get an autocomplete working and making an Ajax form submission on change, and so far the first is working but not the second. I am using jQuery UI Autocomplete with Combobox, http://jqueryui.com/demos/autocomplete/#combobox. From my Django template, I define a handler, presently beginning with an alert that seems never to have been triggered:

function update_autocomplete(event, ui)
    {
    alert("Reached update_autocomplete");
    var split_value = ui.item.value.split(".");
    var field = split_value[0];
    var id = split_value[1];
    $.ajax({
        data:
            {
            id: "Entity_" + field + "_" + {{ entity.id }},
            value: id,
            },
        url: "/ajax/save",
        });
    }

And later on:

$(function()
    {
    $("#department").combobox();
    $("#reports_to").combobox();
    $("#department").bind("autocompletechange",
        update_autocomplete);
    $("#department").bind("autocompleteselect",
        update_autocomplete);
    $("#reports_to").bind("autocompletechange",
        update_autocomplete);
    $("#reports_to").bind("autocompleteselect",
        update_autocomplete);
    });

In the webpage rendered, the UI seems show the desired behavior apart from triggering the save-related event. Neither Chrome nor Firefox report errors. And the alert provisionally put in seems not to have triggered even once.

Am I approaching this problem in the right way? If I have the wrong approach, what is the correct approach to make a jQuery UI autocomplete that will save on an entry being chosen?

Thanks,

–edit–

I’ve replaced the second snippet with:

$(function()
    {
    $(".autocomplete").combobox();
    $(".autocomplete").autocomplete({select: update_autocomplete});
    $(".autocomplete").bind({"autocompleteselect": update_autocomplete});
    $(".autocomplete").bind({"autocompletechange": update_autocomplete});
    });

The behavior seems to be unchanged.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T04:12:51+00:00Added an answer on May 16, 2026 at 4:12 am

    This works for me:

    I set the event handler in the original autocomplete method call. I’m assuming that #department is the autocompleted input.

    $("#department").autocomplete({
        source: my_source,
        select: function(event, ui) {
            update_autocomplete(event, ui);
        }
    });
    

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to get autocomplete working working with JQuery UI, but I am
I'm trying to get an autocomplete form working, and I can't seem to figure
Im trying to get autocomplete-rails.js working in Rails with Ajax, i Have the following
I'm trying to get autocomplete to work on clones by using delegate, but it
I am trying to get autocomplete working on any div with the id=train however,
I've been trying to get the Zend Jquery autocomplete function working, when i noticed
I'm trying to get the jQuery UI autocomplete widget to work but I'm having
I've got autocomplete working fine, but I'm trying to figure out way to make
I'm testing the JQUery Tools and trying to get a modal form working with
I'm trying to get jQuery autocomplete working. The problem is that my json array

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.