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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:59:16+00:00 2026-05-23T00:59:16+00:00

I am using the datepicker ui for jQuery. The calendar is loading fine. Now

  • 0

I am using the datepicker ui for jQuery. The calendar is loading fine. Now I want to fire an event showing the current date when I select a day. I am trying to use this but not having any luck.

The function looks like this:

$(document).ready(AllPageLoads);

    function AllPageLoads()
    {
        $('#datepicker').datepicker();
        $('table.games tbody tr.top').each(function (index) { if (index % 2 == 0) { $(this).addClass("even"); } else { $(this).addClass("odd"); } });
        $('table.games tbody tr.bottom').each(function (index) { if (index % 2 == 0) { $(this).addClass("even"); } else { $(this).addClass("odd"); } });
    }

    function EpicFail(response, status, error)
    {
        alert(response + " / " + status + " / " + error);

}
$('.selector').datepicker("option", "onSelect", function (dateText, inst) {
  alert(dateText);
 });

html:

<h2>Current Data</h2>

<div id="datepicker">
</div>

<p>All Times Pacific/p>
<table id="games" class="games">
    <thead> 
        <tr>
            <th>Date</th>
            <th>Data</th>
            <th>Col1</th>
            <th>Col2</th>
            <th>Data1</th>
            <th>Data2</th>
            <th>Data3</th>
        </tr>
     </thead>
  <tbody>

  <tr class="left">

        <td>6/9/2011</td>

        <td>901</td>

        <td>Team1</td>

        <td>Payer1</td>

        <td>info1</td>

        <td>OFF</td>

        <td>OFF</td>

    </tr>

    <tr class="right">

        <td>4:05 PM</td>

        <td>902</td>

        <td>Team2</td>

        <td>Palyer2</td>

        <td>info2</td>

        <td>OFF</td>

        <td>OFF</td>

    </tr>
   </tbody>
</table>
  • 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-23T00:59:16+00:00Added an answer on May 23, 2026 at 12:59 am

    When you use $('.selector'). you are telling to jQuery: Look for the element who has class="selector" and perform this function.

    But you don’t have any element with this class name.

    So, to solve the problem, simple add the code:

        function AllPageLoads()
        {
            $('#datepicker').datepicker({
               onSelect: function (dateText, inst) { alert(dateText); }
            });
            $('table.games tbody tr.top').each(function (index) { if (index % 2 == 0) { $(this).addClass("even"); } else { $(this).addClass("odd"); } });
            $('table.games tbody tr.bottom').each(function (index) { if (index % 2 == 0) { $(this).addClass("even"); } else { $(this).addClass("odd"); } });
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to implement a event calendar using jquery-ui's datepicker. I've successfully installed the
I am using jquery mobile datepicker, i need to capture the calendar click event,
I am using jquery datepicker for my application. I want to highlight the dates
I'm using the jQuery datepicker where I have two textboxes (start date / end
I'm using the JQuery DatePicker as a little Calendar Dashboard, marking dates with agenda
I am using Jquery Datepicker in my application. It is working fine on all
I'm using inline calendar of this jQuery inline datePicker plugin. By default the days
I am using jquery ui datepicker this way: $('<input type=text />').datepicker({ buttonImage: http://localhost:2000/proj/styles/calendar/images/calendar/cal.gif }).appendTo(container);
I'm using jQuery DatePicker and it shows wrong date for November, 2009. You can
Im using Jquery datepicker and also a PhP calender in my webpage. I want

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.