Hi,

first, sorry for my english.. not perfect..

second point, i should say thanks to kelvinluck for this great jquery plugin, the DatePicker V2 !

I'm trying to use it.. and i have some problems with IE6..

I've used the source from this page of example :
http://kelvinluck.com/assets/jquery/datePicker/v2/demo/datePickerIntoSelects.html

But it seems the date.js file makes IE6 finds an error.. so it doesn't work..

here is my code :

First, the scripts to include :

<script type='text/javascript' src='/js/jquery-1.1.2.js'></script>
<script type="text/javascript" src="/js/date.js"></script>
<script type="text/javascript" src="/js/date_fr.js"></script>
<script type="text/javascript" src="/js/jquery.dimensions.pack.js"></script>
<!--[if IE]><script type="text/javascript" src="/js/jquery.bgiframe.js"></script><![endif]-->
<script type="text/javascript" src="/js/jquery.datePicker.js"></script>
<link rel="stylesheet" type="text/css" media="screen" href="/css/datePicker.css">


And then :

<script type="text/javascript" charset="utf-8">
$(function()
        {
                                
                // initialise the "Select date" link
                $('#date-pick').datePicker(
                                // associate the link with a date picker
                {
                        createButton:false,
                        startDate:'18/05/2007',
                        endDate:'11/12/2007'
                }
                ).bind(
                // when the link is clicked display the date picker
                'click',
                function()
                {
                        updateSelects($(this).dpGetSelected()[0]);
                        $(this).dpDisplay();
                        return false;
                }
                ).bind(
                // when a date is selected update the SELECTs
                'dateSelected',
                function(e, selectedDate, $td, state)
                {
                        updateSelects(selectedDate);
                }
                ).bind(
                'dpClosed',
                function(e, selected)
                {
                        updateSelects(selected[0]);
                }
        );
                                        
        var updateSelects = function (selectedDate)
        {
                var d = selectedDate.getDate();
                var m = selectedDate.getMonth();
                var y = selectedDate.getFullYear();
                ($('#d')[0]).selectedIndex = d - 1;
                ($('#m')[0]).selectedIndex = m;
                ($('#y')[0]).selectedIndex = y - 2007;
        }
        // listen for when the selects are changed and update the picker
        $('#d, #m, #y')
        .bind(
        'change',
        function()
        {
                var d = new Date(
                $('#y').val(),
                $('#m').val()-1,
                $('#d').val()
        );
        $('#date-pick').dpSetSelected(d);
        });
                                
        // default the position of the selects to today
        var today = new Date();
        ($('#d')[0]).selectedIndex = today.getDate() - 1;
        ($('#m')[0]).selectedIndex = today.getMonth();
        ($('#y')[0]).selectedIndex = today.getFullYear() - 2007;
        
        // and update the datePicker to reflect it...
        $('#d').trigger('change');
});
</script>


It works well with Firefox But IE6 complains about a missing "]" on line 7, car 94.. code : 0.. i don't know what to do to make it work.. and that line/char reference doesn't mean anything.. BUT the error message changes when i remove the date.js from the called scripts.. ?

Any helps or advices .. ?

Thanks !!

Reply via email to