I've got a view with a few exposed filters. Is there a way to change the submit speed of the ajax request? So that rather than submitting the request after every key press, it waits until no keypress has been registered for say 500ms before submitting the request? I'm having problems, especially on mobile, where you might type "ar" in the exposed filter, but end up seeing the results for "a", with the filter set back to "a".

1 Answer 1

function do_search(e) {
  search_timer = setTimeout(function() {
    var v = $("#YOUR_INPUT_VAR_ID").val();
  }, 500);
  • Basic idea for seems right, but I didn't try it. I found the timer in ctools/js/auto-submit.js. Since I wanted to make the change everywhere, so I cheated and modified things that, rather than add something custom. So, in a roundabout way, thanks for the lead. Commented Mar 7, 2012 at 0:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.