how to clear search input with button
how to clear search input with button
Hey there,
I would like to clear the search input field when I click on a button but I don't find the id or the name of this search input. Could you tell what is the name or the id of this Search input field, please ?
[code]
[/code]
I would like to clear the search input field when I click on a button but I don't find the id or the name of this search input. Could you tell what is the name or the id of this Search input field, please ?
[code]
[/code]
This discussion has been closed.
Replies
I am not sure, what you mean ... The name of your input field is "begin".
I do it this way: for every column I generate a input field with PHP with an unique id, e.g. id="search". $i, where $i is a PHP var, that is incremented. When I click on a button, basically I do the same things on the specific input element like Allan does in the blur function (have a look here, e.g.: http://www.datatables.net/release-datatables/examples/api/multi_filter.html). After that I do am calling fnFilter with an empty search term.
Hope it helps.
Regards
Thanks for your reply. Actually, it's the search field of the datatable that I want to clear before to submit. Indeed, if an user forgot to clear the search field of the datatable, it will take only the last one which has been selected. That's why I would like to clear it but I don't know how to do it.
Regards,
Jarod.
I mean the global search box at the right top of the datatable.
[code]var dataTableFilter = find(".dataTables_filter");[/code]
then find the input field inside of dataTableFilter and then add a custom ID with
[code]find("input").attr("id", "globalSearchField")[/code]
With that I can easily alter my input field (later or immediately) .