[% DEFAULT skip_hash = 0 %]
[% DEFAULT skip_form = 0 %]
[% IF !skip_form %]<form action="#" method="GET">[% END %]
<input
    type="text"
    placeholder="[% DEFAULT placeholder = 'filter'; placeholder %]"
    id="table_search_input"
    class="deletable autofocus [% DEFAULT extraCls = ''; extraCls %]"
    onchange='table_search(this.id, [% encode_json_obj(ids) %], undefined, [% IF skip_hash %]false[% ELSE %]true[% END %])'
    onkeyup='table_search(this.id, [% encode_json_obj(ids) %], undefined, [% IF skip_hash %]false[% ELSE %]true[% END %])'
    onfocus='table_search(this.id, [% encode_json_obj(ids) %], true, [% IF skip_hash %]false[% ELSE %]true[% END %]); this.autocomplete="on"'
    autocomplete="off"
>
[% IF !skip_form %]</form>[% END %]
[% IF !skip_hash %]
<script>
<!--
[%+ FOREACH id = ids +%]
    var filter = get_hash(2);
    if(filter != undefined) {
        jQuery('#table_search_input').val(filter);
        init_deletable_inputs();
    }

    jQuery(document).ready(function() {
        // preserve hash
        jQuery("TABLE#[% id %] A").on('click', preserve_hash);
    });
[%+ END +%]
-->
</script>
[% END %]
