title: jQuery Autocomplete Validation - How to make a selection required?
body: <p>I'm using jQuery autocomplete on a text box so the user can select a trade. I need to make this a required field. I'm also using jQuery Validation.</p>
  
  <p>Here's my autocomplete cpde:</p>
  
  <pre><code>$(\"#trade\").autocomplete({
      source: " . $tradeString . ",
      maxHeight:100,
      autoFill: true,
      minLength: 3,
      close: function() { $(\"#form\").validate().element(\"#trade\"); }
  }).select(function() {
      $(this).autocomplete(\"search\");
  });
  </code></pre>
  
  <p>And here's my jQuery validation code:</p>
  
  <pre><code>$("#form").validate({   
      errorElement:   "div",
      validClass:     "input_ok",
      errorClass:     "validation_error",
      rules: {    "address[postcode]":         { required:     true},
                  "general[trade]":           { required:     true},
                  "address[address_line_1]":   { required:    true},
                  "address[address_line_2]":   { required:    true},
                  "address[address_line_3]":   { required:    true},
                  "general[trade]":           { remote:       true,
                                                 required:     true}
  
            },
       messages: {    trade:                  { remote: "Trade not found."}                               
            }
  });
  </code></pre>
  
  <p>Can anyone help me out? I've done this before, but using a remote call to a PHP script that looked up the trade from the database. This isn't necessary on this occasion as $tradeString returns the list of trades in the format the autocomplete expects.</p>