Help with Datepicker passing date over

Help with Datepicker passing date over

Hi all, bit inexperienced with jquery, I have been provided this code to drop into a hotel web site which has a check in and check out calendar which passes variables over to a 3rd party booking system. 

It works ok but I want the check in date to pass over to the check out date, so if someone picks the 10th June on check in the check out calendar will start from the 11th June, I found a few other posts on this on the forum but it stopped working entirely, hoping someone can point out what is wrong, here is the code as I have it now:

jQuery(document).ready(function() {
            jQuery("#arrive").datepicker({dateFormat: 'mm/dd/yy', minDate: '-0d', autoSize: true});
            jQuery("#depart").datepicker({dateFormat: 'mm/dd/yy', minDate: '+1d', autoSize: true});
            jQuery("input[type=image]").click(function() {
                jQueryarrivalDate = jQuery("#arrive").datepicker("getDate");
                jQuerydepartureDate = jQuery("#depart").datepicker("getDate");
                jQuery("#arrError").text( jQueryarrivalDate != null ? '':'*');
                jQuery("#depError").text( jQuerydepartureDate != null ? '':'*');
                return ($arrivalDate != null) && (jQuerydepartureDate != null) &&
                        ($arrivalDate.getTime() < jQuerydepartureDate.getTime());
            });
        });

Any assistance greatly appreciated
    • Topic Participants

    • info