Hi deranders,
Unfortuantely, that won’t work if you’re jumping from one page to the next. The JavaScript has to be executed on the page where the booking form exists, so you’d have to pass the date to that URL, then retrieve and process it in JavaScript on the booking form page.
Pass the date with the URL:
<a href="https://yoursite.com/reservation/?rtbdate=2014-03-30">mylink</a>
Then you’d need some JavaScript to capture that date if it exists and update it on the booking form page:
function getQueryVariable(variable)
{
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if(pair[0] == variable){return pair[1];}
}
return(false);
}
var date = getQueryVariable( 'rtbdate' );
if ( date !== false && typeof datepicker !== 'undefined' ) {
datepicker.set( 'select', date );
}
Of course, none of that code is tested. But hopefully it gives you an idea.
(getQueryVariable courtesy of css-tricks.com)