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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:27:54+00:00 2026-06-01T10:27:54+00:00

I have a dynamic drop down box which calls another PHP page. I’ve got

  • 0

I have a dynamic drop down box which calls another PHP page. I’ve got it to work just how I want it.

Below is the part of the form:

<tr>
 <td> 
       <p> Select a delivery date </p>
 </td> 
 <td>
     <select name='listdate' onchange='showDelivery(this.value)'>
       <option value=''>select delivery type:</option>
       <option value='forwardorder'>Forward Order</option>
       <option value='byreturn'>By Return</option>
    </select>

  <div id='txtHint'>
    <b>Change to drop down box to display delivery date</b>
  </div>
 </td> 
</tr>

The Ajax

function showDelivery(str)
{
  if (str=="")
  {
    document.getElementById("txtHint").innerHTML="";
    return;
  } 
  if (window.XMLHttpRequest)
  {
    // code for IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp=new XMLHttpRequest();
  }
  else
  {
    // code for IE6, IE5
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }

  xmlhttp.onreadystatechange=function()
  {
    if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
      document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
    }
  }
  xmlhttp.open("GET","getDelivery.php?q="+str,true);
  xmlhttp.send();
}

The php script


$q=$_GET["q"];

    // And create a cid object
    require_once $CID_INCLUDE_PATH . "/cid.php";
    $cid = new CHCID();

    if ($q == 'forwardorder') 
    {
    echo"<td><select 'name'='deliveryDate'/> "; 
    $listCapacityDates = $cid->ListCapacity();
    foreach($listCapacityDates as $x) {
    echo "<option value='".$x."'>".$x."</option> </select>"; 
    }
    } 

    if ($q == 'byreturn')
    {
    echo"<div id='div1'>Enter By Return Date<input type='text''name='deliveryDate' />
    </div>"; 
    } 

I know the problem, because the results from the Ajax drop downs are shown through the PHP pages when the form submits none of those values are submitted. But I’m not sure how I can even submit them? Any ideas?

  • 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-01T10:27:56+00:00Added an answer on June 1, 2026 at 10:27 am
    echo"<td><select 'name'='deliveryDate'/> ";
    

    should be :

    echo "<td><select name='deliveryDate'/> "; 
    

    and

    echo"<div id='div1'>Enter By Return Date<input type='text''name='deliveryDate' />
    

    should be :

    echo"<div id='div1'>Enter By Return Date<input type='text' name='deliveryDate' />
    

    and:

        if ($q == 'forwardorder') 
        {
        echo"<td><select 'name'='deliveryDate'/> "; 
          $listCapacityDates = $cid->ListCapacity();
          foreach($listCapacityDates as $x) {
            echo "<option value='".$x."'>".$x."</option>"; 
            }
        echo "</select></td>";
        } 
    

    </select> should be outside foreach

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

Sidebar

Related Questions

I have a page on my site which has multiple drop down boxes as
I want to have multiple drop box with around three on the page at
I have dynamic select drop-down menus. For example, if you select a specific month,
I have a web form that I am attempting to implement dynamic drop down
I have two Drop Down Lists, the second ones are based off which one
I have this form section with dynamic clone of select drop down menus. The
I have a drop down list (select) populated from SQL. This is dynamic so
I am creating an dynamic controls I have an drop down with options Textbox,
I have Drop Down List control and add dynamic add option into Dropdownlist but
I have a dynamic two level UL LI drop down menu in wp. Actually,

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.