Write a date in a datatable search field
Hi at all ,sorry for english , i have a datatable ,with your's search field input , i add an id to this field(id="ricerca_data")in the jquery.datatables.min.js and if i see in console i see this id .
I insert a new field to search data by datepicker :
- <label>Ricerca per data</label>
- <br>
- <input type="text" name="" id='select_data' value="">
- <br>
- <br>
- <input type="button" class='btn btn-warning' name="name" id='ricerca_button' value="Ricerca">
And insert this script :
- $(document).ready(function() {
-
-
-
- $.fn.dataTable.moment( 'DD-MM-YYYY' );
-
- $('#datatable').DataTable({
-
-
- "order": [ 2, 'desc' ]
-
- });
-
- $('#select_data').datepicker({
- format: "dd/mm/yyyy",
- language: 'it',
- viewMode: 'years',
- });
-
- $("#ricerca_button").click(function(){
-
- var data_selected= $("#select_data").val();
- console.log(data_selected);
- $("#ricerca_data").text(data_selected);
- });
-
-
- });
The data appear on console ,but the data isn't write on search field .
Can you help me ?