As for the datepicker to check the date in the correct format?

Like in jquery datepicker to check the date in the correct format and output the alert if the format is not correct ? Now doing so

$('.date_input').die('change').live('change', function(){


 $(this).datepicker("option", "dateFormat", 'dd-M-yy');


 });


but in this version, just cleaned date field if the date is not correct, but I need at least alert the user to show.
June 27th 19 at 15:32
1 answer
June 27th 19 at 15:34
$('.date_input').die('change').live('change', function(){
 $(this).datepicker("option", "dateFormat", 'dd-M-yy');
 if ($(thid).datepicker( "getDate" )) return true; 
 else alert("WTF?!");
 });

Find more questions by tags JavaScript