asmaoui / jquery-datepicker

Automatically exported from code.google.com/p/jquery-datepicker
0 stars 0 forks source link

How to catch the close event? #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Thank you so much for a great calendar.
I am not sure if this is a problem or not.
I am trying to cath the close event what should I do.

Here is the code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 
Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-
transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

<script type="text/javascript" src="js/jquery/jquery-
1.2.6.min.js"js/jquery-1.2.6.min.js"></script>
<script type="text/javascript" src="DatePickerFiles/date.js"></script>
<script type="text/javascript" 
src="DatePickerFiles/jquery.datePicker.js"></script>

<link rel="stylesheet" type="text/css" media="screen" 
href="DatePickerFiles/datePicker.css">

        <!-- page specific scripts -->
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {      

      $(function()
            {
                $('.date-pick').datePicker();
            });

        $('.date-pick').datepicker({
            _closeCalendar: function(date1) { 
            //Use this callback function to define what will 
happen when someone picks a date

            alert('d');
            //alert(date);
        }
    });
});

</script>

</head>

<body>

 Testing Daet Picker
 <br />
    <input name="date1" id="date1" class="date-pick" /> 
</body>
</html>

Original issue reported on code.google.com by karyani....@gmail.com on 23 Jan 2009 at 5:39

GoogleCodeExporter commented 9 years ago
Instead of listening for the calendar close event you probably want to listen 
for
when somebody selects a date like in this example:

http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/datePickerListen.html

Basically you bind to a 'dateSelected' event from the element you called 
datePicker on...

There is also a 'dpClosed' event you can listen to instead - you can see the
arguments it gets passed in the documentation here:

http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/documentation.html

Hope that helps,

Kelvin :)

Original comment by kelvin.l...@gmail.com on 23 Jan 2009 at 8:50