Don't permit autocomplete in search input?

Don't permit autocomplete in search input?

j2edavilaj2edavila Posts: 2Questions: 1Answers: 0
edited May 2019 in Free community support

Hello,
I am creating a basic table with a search, but when init the search loaded an autocomplete data.

This is the structure I am using:

$('#'+div).dataTable({
"searching": true,
"language": {
"lengthMenu": "Por página: MENU",
"zeroRecords": "Sin resultados",
"info": "Mostrando página PAGE de PAGES",
"infoEmpty": "No hay registros disponibles",
"infoFiltered": "(Filtrado de MAX registros en total)"
},
"order": [[ 0, 'desc' ]]
});

¿who i cant block de autocomplit?

Answers

  • j2edavilaj2edavila Posts: 2Questions: 1Answers: 0

    My solution

    $('#'+div).dataTable({
           /** add this */
            initComplete: function() {
                $(this.api().table().container()).find('input').parent().wrap('<form>').parent().attr('autocomplete', 'off');
            },
             /****** add this */
            "searching": true,
            // "autoFill": true,
            "language": {
                "lengthMenu": "Por página: _MENU_",
                "zeroRecords": "Sin resultados",
                "info": "Mostrando página _PAGE_ de _PAGES_",
                "infoEmpty": "No hay registros disponibles",
                "infoFiltered": "(Filtrado de _MAX_ registros en total)"
    
            },
            "order": [[ 0, 'desc' ]]
        });
    
This discussion has been closed.