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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T23:12:22+00:00 2026-05-20T23:12:22+00:00

Hey all, I know this question has been asked a million times before but

  • 0

Hey all,
I know this question has been asked a million times before but I just can’t seem to convert the answers into my personal project. I have a selector on my page that needs to send an AJAX query to my database and retrieve the results and print them under the selector. Thank you to anyone who can clarify what needs to be done for this to work.

Here is the php file called “view.php” minus the query I make to the database.

$depView = $_POST['depView'];

foreach($result as $entry){
echo  '<div>' . $entry['department']. $entry['CRN']. ' ' . $entry['title'] . ' ' . $entry['addDate'] . '</div>';
}

Here is my Javascript thus far:

function getProps(data){
        $.post("view.php", {depView: data}, html)

        }

Here is my selector:

<select onchange="getProps(value);" name="depView">
        <option value=""></option>
        <option value="CSC">CSC</option>
        <option value="MAT">MAT</option>
        </select></br>
  • 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-20T23:12:23+00:00Added an answer on May 20, 2026 at 11:12 pm

    HTML:

    <select name="depView" id="depView">
      <option value=""></option>
      <option value="CSC">CSC</option>
      <option value="MAT">MAT</option>
    </select><br />
    <div id="ajaxResults"></div>
    

    JavaScript:

    <script type="text/javascript">
    
    // on DOM load
    $(function () {
    
      $('#depView').change(function () {
        $.post('view.php',
           { depView: $(this).val() },
           function (data) {
             $('#ajaxResults').html(data);
           },
           'html'
           );
      });
    
    });
    
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey all, I know that this question has been asked many times in this
Hey, sorry for posting this here, I know that this question better suites into
I know this is quite possibly a lame question, but I've pulled three consecutive
Hey all, my Computational Science course this semester is entirely in Java. I was
Hey all. Newbie question time. I'm trying to setup JMXQuery to connect to my
Hey all, I'm pulling my hair out on this one. I've checked all my
Firstly, please don't dismiss this question - I'm aware it's an ugly situation but
Hey all. I have a question regarding PHP's If shorthand. Is it possible with
Hey all, I have a question about perl objects and threading. My program is
Hey all, I have something of an interesting requirement for my project. I need

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.