Im having hard time making this Datepicker works in all my fields
It works only in one field if try to do the same in another it doesnt appear
default.ctp
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script>
$(function() {
$(".datepicker").datepicker(
{
dateFormat: 'dd-mm-yy',
onSelect: function(dateText, inst){
$('#select_date').val(dateText);
$("#datepicker").datepicker("destroy");
}
}
);
});
</script>
add.ctp
echo $this->Form->input('support_start_date', array(
'id'=>'datepicker',
'type'=>'text'
), ['empty' => true]);
echo $this->Form->input('end_date_support', array(
'id'=>'datepicker',
'type'=>'text'
), ['empty' => true]);
Here it works on support_start_date
But when I try to do the same on end_date_support it doesn’t show at all
ContactTable.php
$validator
->dateTime('support_start_date')
->allowEmpty('support_start_date');
$validator
->dateTime('end_date_support')
->allowEmpty('end_date_support');