0

Before anyone says, I have already searched this but the solutions given (i.e. using "getDate" on the datepicker) won't work in this instance as I do not have direct access to the datepicker that's generated.

So, I have a date picker on my WooCommerce store which records as a "Booking Date" for activities my client is selling. However, due to some complex activity clashing matrix (which I won't go into) I need to be able to grab the selected date in order to determine the max quantity of attendees allowed.

Currently I'm using this:

jQuery(".wccpf-datepicker").on("blur", function() {
     console.log(jQuery(".wccpf-datepicker").val());
});

where wccpf-datepicker is the class of the field where the datepicker is, but the result is always null due to the fact that the blur event triggers as soon as the mouse is moved over to the calendar picker, so it gives me a null result as the date has not been chosen.

Is there any other event trigger I can use to get this to work, or do I need to use some other method?

Thank you

Michael Emerson
  • 1,774
  • 4
  • 31
  • 71

0 Answers0