I am trying to validate that the return date is after departure, I cant think of how to write the function. I was thinking one approach would be to strip the ( / ) forward slashes from the dates picked from the datepicker ( ) so they are whole integers and store them into new variables then use a if/else statement to alert if the return date < departure date.
Anyone know if this would be the right way to go?? if so how do i go taking the input from the datepicker() and strip the slashes??
$(document).ready(function(){
var destinations = [];
destinations[0]='italy';
destinations[1]='france';
destinations[2]='california';
destinations[3]='miami';
destinations[4]='Denver';
destinations[5]='chicago';
var departing = $('#departing').datepicker();
var returning = $('#returning').datepicker();
$('#destination').autocomplete({source:destinations});
$('input').focus(function(){
$(this).css('outline-color', 'skyblue');
}); // end focus function
}); // end document Ready