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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T19:51:09+00:00 2026-06-03T19:51:09+00:00

I have a form which has a drop down list for countries. If the

  • 0

I have a form which has a drop down list for countries.

If the user chooses one of the countries (onchange),
a new drop down list for cities appears
displaying only the cities of this specific country.

<select name = \"countries\" id=\"ListOfCountries\" onchange=\"showCities(this.value)\">

I have implemented that by using php, mysql and ajax.

The tutorial i have
studied and followed is in the following link:

http://www.w3schools.com/php/php_ajax_database.asp

The drop down list for cities is displayed automatically on the web page
without loading the page again.

When the cities box appears, if i do
Ctrl-U in order to see the source code of the page,
the html code for the drop down list of cities is not in the source code page.

My problem is that when i submit the form,
the value of the cities’ drop down list
is NOT sent to the submit.php file

index.php

 <form action="submit.php" name="my_form" method="post">

submit.php

 echo $_POST['cities'];

The $_POST[‘cities’]; is blank.

That means that in the submit page NO value
for cities’ drop down list was sent.

What am i supposed to do in order to fix that?

Thanks, in advance

  • 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-03T19:51:10+00:00Added an answer on June 3, 2026 at 7:51 pm

    It seems like you are not updating the DOM correcly, so the cities parameter is not avaible when you submit the form.
    If you use jQuery, use jQuery.after() or any similar function to update the DOM. If not you’ll have to create a node with the select and add it into the form.

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

Sidebar

Related Questions

I have written a simple CRUD form which has one select list. However the
I have a page, it has a drop down list, which contains the names
I have a drop down list on a form view which are both bound
I have a page which has a drop list inside a form. The drop
I have two separate fields with a drop-down list, one is for User and
I have this html form which has options: <tr> <td width=30 height=35><font size=3>*List:</td> <td
I have a drop down which has a method which binds data to it:
I have a select list drop down in my Rails application, in the form
I have a form in an ASP.NET MVC project which has a select drop
I have an Excel2010 VBA userform that has one comboBox, from which the user

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.