[% END %]
$("#adv-search-form").on("submit", function(){
// Prevent searching on the wrong index by clearing selects
var idx = $("select[name='idx']");
var i = 0;
$("input[name='q']").each(function(){
if( !$(this).val().length ) {
$("#search-field_"+i).val("");
}
-