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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:45:49+00:00 2026-05-27T07:45:49+00:00

I am trying to retrieve on server-side the value from the selected option sent

  • 0

I am trying to retrieve on server-side the value from the selected option sent using a jQuery .load() call like this:

<script type="text/javascript">
        $(function () {
          $("#first").change(function () {
            $("#second").load('populate_section.php?year=', {first: $(this).val()});
          });
        });
</script>

<tr>
  <td>
    <select id="first" name="year">
      <option value=""></option>
      <option value="1">1</option>
      <option value="2">2</option>
      </select>
  </td>
</tr>
<tr>
  <td>
    <select id="second" name="section">
    </select>
  </td>
</tr>

Then how I try to retrieve the value in my PHP code :

<?php
$year = $_GET['year']; // for test only
echo "<option>" . $year . "</option>";
?>

I assume here that the result will be a dropdown box with a value of whatever I chose on the first dropdown. However, it seems that var $year is empty.

Thanks.

  • 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-27T07:45:50+00:00Added an answer on May 27, 2026 at 7:45 am

    You have not set any value for “year” GET variable in the URL.
    If you need to send $(this).val() as the “year”, do it like below code.

    $("#second").load('populate_section.php', {"year": $(this).val()});
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to retrieve a file from a server using SFTP (as opposed to
I am trying to retrieve the ByteArray from a file selected using the FileReference
I'm trying to retrieve list data from a Sharepoint 2010 server using the webservice
I'm trying to retrieve data from an SQL Server 2000 server, and place into
I've been trying to retrive attachment from message in Exchange 2003 server using WebDAV.
i am trying to retrieve the data from the server with Linq ,there are
Is it possible to 'translate' headers from this firefox extension into server side script?
I am trying retrieve data from a .php file on a server from within
I am trying to retrieve an image from SQL Server (yes, data type is
I am trying to retrieve around 200 billion rows from a remote SQL Server.

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.