title: Get text from field on keyup, but with delay for further typing
body: <p>I have a form which is submitted remotely when the various elements change.  On a search field in particular I'm using a keyup to detect when the text in the field changes.  The problem with this is that when someone types "chicken" then the form is submitted seven times, with only the last one counting.</p>
  
  <p>What would be better is something like this</p>
  
  <ul>
  <li><p>keyup detected - start waiting (for one second)</p></li>
  <li><p>another keyup detected - restart waiting time</p></li>
  <li><p>waiting finishes - get value and submit form</p></li>
  </ul>
  
  <p>before I go off and code my own version of this (I'm really a backend guy with only a little js, I use jQuery for everything), is there already an existing solution to this?  It seems like it would be a common requirement.  A jQuery plugin maybe?  If not, what's the simplest and best way to code this?</p>
  
  <p>UPDATE - current code added for Dan (below)</p>
  
  <p>Dan - this may be relevant.  One of the jQuery plugins I'm using on the page (tablesorter) requires this file - "tablesorter/jquery-latest.js", which, if included, leads to the same error with your code as before:</p>
  
  <blockquote>
    <p>jQuery("input#search").data("timeout", null) is undefined
    http&zwj;://192.168.0.234/javascripts/main.js?1264084467
    Line 11</p>
  </blockquote>
  
  <p>Maybe there's some sort of conflict between different jQuery definitions? (or something)</p>
  
  <pre><code>$(document).ready(function() {
    //initiate the shadowbox player
  //  Shadowbox.init({
  //    players:  ['html', 'iframe']
  //  });
  }); 
  
  jQuery(function(){
    jQuery('input#search')
      .data('timeout', null)
      .keyup(function(){
        jQuery(this).data('timeout', setTimeout(function(){
            var mytext = jQuery('input#search').val();
            submitQuizForm();
            jQuery('input#search').next().html(mytext);
          }, 2000)
       )
       .keydown(function(){
         clearTimeout(jQuery(this).data('timeout'));
       });
      });
  });
  
  function submitQuizForm(){
    form = jQuery("#searchQuizzes");
    jQuery.ajax({
      async:true, 
      data:jQuery.param(form.serializeArray()), 
      dataType:'script', 
      type:'get', 
      url:'/millionaire/millionaire_quizzes',
      success: function(msg){ 
       // $("#chooseQuizMainTable").trigger("update"); 
      }
    }); 
    return true;
  }
  </code></pre>