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

  • Home
  • SEARCH
  • 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 7528205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:18:50+00:00 2026-05-30T04:18:50+00:00

I am using joomla calendar to pick a date. Below shows the html code

  • 0

I am using joomla calendar to pick a date. Below shows the html code of it. here when you click the image, calendar will pop up and there you can select a date and popup will close and date value show in input text field. What I want is I want to write a function to do a ajax post if the date is change.(input text change). I tried simple alert() but didn’t work. I think it is due to lost focus on the text field because only the image that we click and no contact with input field with mouse or any key press. plz help me to solve this.

$("#select_date").change(function(){
   alert('Working');
});

HTML Code

<input id="select_date" type="text" value="2012-02-16" name="select_date" title="Thursday, 16 February 2012">
<img id="select_date_img" class="calendar" alt="Calendar" src="/eap_movies/media/system/images/calendar.png">

PHP Code

JHTML::_('behavior.calendar');
JHTML::calendar(date('Y-m-d'),'select_date', 'select_date', '%Y-%m-%d');
  • 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-30T04:18:51+00:00Added an answer on May 30, 2026 at 4:18 am

    Mihai Bazon’s DHTML Calendar v1.0 (under /media/system/js/calendar.js) has a callback for onSelected and onClose events. So it should be possible to catch when the calendar closes or when the user selects a date.

    Solution 1 – Editing Joomla

    Step 1 – You need to override this file: libraries/joomla/html/html.php

    // added $onSelected parameter
    public static function calendar($value, $name, $id, $format = '%Y-%m-%d', $attribs = null, $onSelected)
    {
      ...
    $document->addScriptDeclaration('window.addEvent(\'domready\', function() {Calendar.setup({
                inputField: "'.$id.'",          // id of the input field
                ifFormat: "'.$format.'",        // format of the input field
                button: "'.$id.'_img",          // trigger for the calendar (button ID)
                align: "Tl",                            // alignment (defaults to "Bl")
                singleClick: true,
                onSelected: '.$onSelected.'
    });});');
    ...
    }
    

    Step 2 – Defining a callback for onSelected

    JHTML::_('behavior.calendar');
    JHTML::calendar(date('Y-m-d'),'select_date', 'select_date', '%Y-%m-%d', null, 'userSelectedDate');
    

    Step 3 – Implementing the callback

    function userSelectedDate(calendar, date){ ... }
    

    Note: I don’t have an active install of Joomla so the code above might have syntax errors.

    Solution 2 – Sara’s easier solution

    Add onchange definition to the $attribs parameter of JHTML::calendar:

    JHTML::calendar(date('Y-m-d'),'select_date', 'select_date', '%Y-%m-%d','onchange="myfunction();"');

    Visit DHTML Calendar Website as well.

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

Sidebar

Related Questions

I'm using Joomla 1.5.14 and I configured SEO as in the following image Now
using a joomla component that pulls an image from the database for a slideshow.
I am using Joomla 1.7 with a Yootheme template. There is an option to
I am using Joomla 1.5 and VirtueMart 1.1.3. There is an issue where tmp
I am using Joomla 1.5. i am having a page where a cSS has
I've started using Joomla 1.5 recently and am using the TinyMCE online WYSIWYG editor
This is my first time using joomla. I don't know if I'm using the
Using ASP.NET MVC there are situations (such as form submission) that may require a
Using C# and System.Data.SqlClient, is there a way to retrieve a list of parameters
I'm using Joomla 1.5 and installed Joomap to create site map. I found that

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.