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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:54:24+00:00 2026-05-31T21:54:24+00:00

Finally figured it out thanks to One Mad Monkey, but forgot quotes on my

  • 0

Finally figured it out thanks to One Mad Monkey, but forgot quotes on my $eventDate variable for the SQL query. Thanks for the help guys 🙂

  $(".date_has_event").live("click",function(){
    console.log('you clicked', this);

    var dateClicked = $(this).attr('id');
    $.ajax({
            type:"GET",
        url: "popup_events.php",
        data:"date="+dateClicked,
        success: function(data){
            $(".popupContent").html(data);
        }});
        //centering with css
        centerPopup();
        //load popup
        loadPopup();

    });  

This is linked to my popup_events.php file:

<?php

    include ("Includes/dbConnect.php");

    $eventDate = $_GET['date'];

    $query = "SELECT * FROM events WHERE eventDate='$eventDate'";
    $check = mysqli_query($cxn,$query) or die("Couldn't execute query!");

    while($row = mysqli_fetch_array($check))
      {
          $id = $row['eventID'];

          echo "<div class='submit_event_list'><a href='individual_event_page_main.php?id=$id'>";
          echo $row['eventName'];
          echo " | " . $row['host'];
          echo " | " . $row['venue'];
          echo " | " . $row['eventDate'];


          echo "</a></div>";
          echo "<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-31T21:54:25+00:00Added an answer on May 31, 2026 at 9:54 pm

    I’m not sure you actually have a question…
    But it seems like you probably just need some help on how to tell which pop up to display.

    in your:

    $(".popup").live("click",function(){})
    

    you can use the special “this” variable to determine which of your day’s was clicked.

    eg.

    $(".popup").live("click",function(){ 
        console.log('you clicked', this);
    
        //to get the date id (your formatdate) from this
        var dateClicked = $(this).parent().parent().attr('id');
    
        //have to do parent() twice because you put your .popup under <div class='title'>
    })
    

    To make it easier.. you should consider changing your click event to use .date_has_event instead of .popup so you could do this instead:

    $(".date_has_event").live("click",function(){ 
        var dateClicked = $(this).attr('id');
    })
    

    once you know you which day was clicked, you probably want to render that day’s popup’s content (the list of events for that day) in your popup window.

    That’s where you should use an ajax request sent to some backend code which is basically the php code you already have shoved behind your (that stuff under your #popupContact).
    You should move that code out somewhere.. in say a “getEvents.php”

    eg.

    $(".date_has_event").live("click",function(){ 
        var dateClicked = $(this).attr('id');
        $.ajax({
            type: "GET",
            url: "getEvents.php",
            dataType: "json",
            data: "date="+dateClicked,
            success: function(data){
               //fill your popup with the data received
    
            }   
        })
    })
    

    I think that should be enough to get you on your way.
    Good luck.

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

Sidebar

Related Questions

I finally figured out what's wrong with my code, but I'm not sure how
I have finally figured out how to generate a random number, but the compiler
I'm new to pattern matching, having finally figured it out. I am stuck trying
I finally got around to trying out django-devserver . It's installed and working but
So I've finally figured out a system for refreshing portions of the screen using
After wasting some time to figure out what goes wrong, I finally have to
Finally deployed my ruby on rails 3.2 app but when trying to open it
I'm transforming xml using the following code. It works fine for one xslt but
I'm starting out my expedition into Project Euler. And as many others I've figured
After one hour of trying to find a bug in my code I've finally

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.