Datatables - Search Box outside datatable in website

Datatables - Search Box outside datatable


 Table:

<table id="evvapplicant" class="table1">
    <thead class="sticky-top">
    <tr>
        <th></th>
    </tr>
    </thead>
    <tbody>        
        <tr>
            <td>
        name
            </td>
        </tr>  
    </tbody>
</table>


Out Side input fields:


<input type="search" id="bookSearch" name="search" placeholder="Search Name">

 

Others functions:

<script src="https://cdn.datatables.net/1.11.3/js/jquery.dataTables.min.js"></script>
    <script>        
    var oTable = $('#evvapplicant').DataTable({
        "paging": false,
        "lengthChange": false,
        "searching": true,
        "ordering": false,
        "info": false,
        "autoWidth": true
    });
    $('#bookSearch').keyup(function(){
      oTable.search( $(this).val() ).draw();
    })        
</script>

Datatables - Search Box outside datatable in website Datatables - Search Box outside datatable in website Reviewed by TechTubeHQ on March 01, 2022 Rating: 5

No comments:

Powered by Blogger.