If you press return in a field it will automatically submit the form. At the same time you submit it via JavaScript, hence submitted twice.
Change to:
Code:
<input type="text" name="${status.expression}" value="${status.value}" id="${status.expression}" onkeydown="return doOnEnter(event,submitSearch);"/>
and
Code:
function doOnEnter(event, action) {
if (event && event.keyCode && event.keyCode == 13 && typeof action == "function") {
return action();
}
}
function submitSearch() {
var searchForm = byId("search_form");
//.... other random checks...
if (searchForm) {
searchForm.submit();
}
// stop form from submit twice
return false;
}
}
I didn't test this, but it should work.
Cheers
G