I have a little javascript function using datepicker in the following way:
function sanchobonanzaandtheballisticballcrunch()
{
$( "#datepicker" ).datepicker();
var currentDate = $( "#datepicker" ).datepicker( "getDate" );
}
that gets called from my .php file with this HTML button:
<button onclick="sanchobonanzaandtheballisticballcrunch();">Click here for DATE</button>
But as my understanding of Javascript is rudimentary, I can’t figure out how to retrieve this date information (probably after reformating it from date object to String) to the calling file and store it in a variable. I am also not sure whether the value of currentDate updates whenever a new date is selected as is, or whether that only happens when the HTML button is pressed.
Try this:
Cheers!