Input type as text instead of search for search bar
Input type as text instead of search for search bar
Data Table input type as text instead of search
I have a system that populate data table using CakePHP and the amazing part is
its search field was something like this
<input type="text" aria-controls="c_table">
And the date table i populate was
<input type="search" class="" placeholder="" aria-controls="c_table">
How do I change my own populated data table search bar as input type "text" instead of "search"
var dt = $('#clients_table').DataTable( {
"processing": true,
"serverSide": true,
"oLanguage": {
"sSearch": "Search"},
"sDom": '<"top"f>irt<"bottom"lp><"clear">'
Above is part of my data table declaration but I think that does not affect the search bar to be search instead of text, I wonder how cake PHP actually change the search as text for data table.
Thanks for helping
Answers
Did you figure this out? I'm having the same issue.
Just use a little bit of jQuery after you initialise the table:
$('div.dataTables_filter input').attr( 'type', 'text' );
Allan
Very good, thank you.