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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:53:10+00:00 2026-06-13T16:53:10+00:00

I have two JQuery UI autocomplete input fields. When an option is selected in

  • 0

I have two JQuery UI autocomplete input fields.
When an option is selected in the first one, the value of the selection will be used as condition for a database query that will send the source data for the second autocomplete field.
My problem is how do I send the value of the first selection to the PHP page via Post method?

The code so far is shown below (this code is from a tutorial which used the GET method; but I want to use Post):

<script>

                          $("input#divisions").autocomplete ({
                                                      //this is the first input 
                          source : [
                                      { value: "81", label: "City1" },
                                      { value: "82", label: "City2" },
                                      { value: "83", label: "City3" }                                       ],
                          minLength : 0,
                          select: function(event, ui) {
                              $('#divisions').val(ui.item.label);

                              return false;
                          },
                          focus: function(event, ui){
                             $('#divisions').val(ui.item.label);
                             return false;    
                          },
                          change: function(event, ui){
                                                              //the tutorial has this value sent by variables in the URL; I want the selection value sent by POST. How can I change this?
                              c_t_v_choices = "c_t_v_choices.php?filter=" + ui.item.value;
                              $("#c_t_v").autocomplete("option", "source", c_t_v_choices);
                          }
                          }).focus (function (event)
                          {
                          $(this).autocomplete ("search", "");
                          });

                          $("#c_t_v").autocomplete({
                              source: "",
                              minLength: 2,
                              select: function(event,ui){
                                  //$('#city').val(ui.item.city);              
                              }
                          });   
</script>

Can anyone please help?
Dont hesitate to let me know if you have any questions.

  • 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-06-13T16:53:12+00:00Added an answer on June 13, 2026 at 4:53 pm

    The solution I found for this is to use AJAX to create the source when a selection is made in the first autocomplete.

    Sample code can be found here: https://stackoverflow.com/questions/12715204/assigning-source-for-jquery-autocomplete

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

Sidebar

Related Questions

I have two jQuery functions. The first one below I want to run first,
I have two jQuery UI Autocomplete widgets set up. With the first autocomplete, the
I have two jQuery autocomplete textboxes on a mvc web page. One that returns
I have two JQuery autocomplete's on a screen. One is mandatory, the other is
I have two autocomplete scripts, one of them makes use of (A) php/mysql/html/jquery and
On my website I have two jQuery UI dialogs. One dialog just shows gif
Assuming I have the following two JQuery functions - The first, which works: $(#myLink_931).click(function
I have two buttons at the top of a jQuery validated form: one saves
I have two scripts running on the same page, one is the jQuery.hSlides.js script
I am using devbridge jquery autocomplete plugin . I have combined two tables in

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.