-1
I have a Picker date like this
$('#datepicker2').on('change', function() {
console.log('Submiting form');
console.log(this.value);
$('#form1').submit();
}).trigger('change');
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.0/themes/base/jquery-ui.css" />
<form action="" name="form1" id="form1" onsubmit="return false" method="POST">
<input type="date" id="datepicker2" name="datepicker2" value="<?php echo date('Y-m-d'); ?>">
</form>
And I’d like to know how I can get the datepicker value to make a select. I use the onchange function because I don’t want to have a button to do Submit but when the user changes the datepicker date.
It is not enough to submit the form (removing the onsubmit Return false) and manipulate the data in your action?
– Darlei Fernando Zillmer
If you take off the onsubmit Return false the page is in an infinite loop refreshing
– MiguelCampos