Hi,
for some reason something on my site has changed the way the the datePicker works. Using the event onSelect() i declared a callback function which sends the selected date to a new page. Since last week friday it seems that the onSelect() event is fired immediately on page load. It seems as though the current day is automatically selected in the same manner that clicking a date would be selected and calls upon onSelect(). The result being that anyone visiting the site with the datePicker jumps to another page immediately.
I'm loading the jQuery and UI library via google's CDN.
- <script type="text/javascript">
- google.load("jquery", "1");
- google.load("jqueryui", "1");
- </script>
And this is how i invoke the datePicker function... for testing purposes i've removed the redirect function and decided to log to Firebug the dateText if called upon.
- $(function() {
- $( '#calendar' ).datepicker({
- dayNamesMin: ['zo','ma','di','wo','don','vr','za'],
- monthNames: ['Playlist januari','Playlist februari','Playlist maart','Playlist april','Playlist mei','Playlist juni','Playlist juli','Playlist augustus','Playlist september','Playlist oktober','Playlist november','Playlist december'],
- minDate: '-1Y',
- maxDate: +7',
- dateFormat: 'yymmdd',
- onSelect: function(dateText, inst) {
- console.log(dateText);
- }
- });
- });
Can anyone help with this issue? How do i prevent onSelect from being called on automatically on page load?
Thanks in advance