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 6753197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:07:56+00:00 2026-05-26T13:07:56+00:00

I have two jQuery UI Autocomplete widgets set up. With the first autocomplete, the

  • 0

I have two jQuery UI Autocomplete widgets set up. With the first autocomplete, the user will enter a client’s name – the autocomplete will narrow it down until the correct client has been chosen. I then have a callback that takes the ID of the client returned and puts it into a hidden input field.

Next, is a second autocomplete field. When searched in, this needs to send two variables to the server – the user’s search string (term), and the User ID of the client that was searched for previously.

I have no problems dealing with the server side of things, but where I’m struggling is how to pass 2 variables to the Ajax call, rather than just term. In my PHP backend, I need to query against the User ID as well, to only return properties belonging to that user.

How can I do this?

Thanks!

Edit: Thanks to @JohnP, this was what I ended up – seems to work fine for me. Posting this here for reference for anyone in future who drops by:

source: function (request, response) {

    var request_data = {
        term: request.term,
        client_id: $('input#client_id_string').val()
    };

    var url = 'http://mysite.com/search/ajax_search';

    $.getJSON(url, request_data, function (data, status, xhr) {
         response(data);
    });
},
  • 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-26T13:07:56+00:00Added an answer on May 26, 2026 at 1:07 pm

    You can override the source method if it’s a static method.

    //code
    source: function (request, response) {
        var term = request.term;
         //caching if yo uwant
         var myCustomVar = 42;
    
         $.getJSON(url + term + '/' + myCustomVar , request, function (data, status, xhr) {
              response(data);
         });
    },
    //code
    

    You can either make it part of the URL or just pass it along with the request, if you want.

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

Sidebar

Related Questions

I'm using two jquery ui widgets, autocomplete and tabs. They each have their own
Assuming I have the following two JQuery functions - The first, which works: $(#myLink_931).click(function
I'm using Jorn Zaefferer's Autocomplete query plugin, http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ I have options set so it
I have two JavaScript files that contain a jQuery function with the same name
I have two jQuery autocomplete textboxes on a mvc web page. One that returns
I have two jQuery plugins that use the same function name (bind), can i
I have two JQuery autocomplete's on a screen. One is mandatory, the other is
I am using devbridge jquery autocomplete plugin . I have combined two tables in
I have two autocomplete scripts, one of them makes use of (A) php/mysql/html/jquery and
I have a page, which uses jQuery Autocomplete on the second two textboxes (investigator

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.