title: Attach Javascript to Certain Form Field Autocomplete
body: <p>I have a Autocomplete Script that works great but i am adding it to a page with MULTIPLE FORMS and now it wont work.</p>
  
  <p>here is the JS:</p>
  
  <pre><code>&lt;script type="text/javascript" src="jquery/js/jquery-1.4.2.min.js"&gt;&lt;/script&gt; 
  &lt;script type="text/javascript" src="jquery/js/jquery-ui-1.8.2.custom.min.js"&gt;&lt;/script&gt; 
  &lt;script type="text/javascript"&gt; 
  
      jQuery(document).ready(function(){
          $('#zipsearch').autocomplete({source:'suggest_zip.php', minLength:2});
      });
  
  &lt;/script&gt; 
  &lt;link rel="stylesheet" href="jquery/css/smoothness/jquery-ui-1.8.2.custom.css" /&gt; 
  &lt;style type="text/css"&gt;&lt;!--
  
          /* style the auto-complete response */
          li.ui-menu-item { font-size:12px !important; }
  
  --&gt;&lt;/style&gt; 
  </code></pre>
  
  <p>and the form With Field is:</p>
  
  <pre><code>&lt;form action="&lt;?php echo $GLOBALS["webroot"]; ?&gt;/index.php?action=&lt;?php echo $GLOBALS["RFA"];?&gt;" method="post" name="postForm1"&gt;
  
  &lt;input name="LocationID" type="text" class="span10" id="zipsearch"&gt;
  </code></pre>
  
  <p>I have tried:</p>
  
  <pre><code>jQuery(document).postForm1.ready(function(){
      $('#zipsearch').postForm1.autocomplete({source:'suggest_zip.php', minLength:2});
  });
  </code></pre>
  
  <p>this was the TEST Form that is in the same folder as the page i am currently working on... everything works on this test page</p>
  
  <pre><code>&lt;html&gt; 
  &lt;head&gt; 
      &lt;title&gt;test jquery autocomplete&lt;/title&gt; 
      &lt;script type="text/javascript" src="jquery/js/jquery-1.4.2.min.js"&gt;&lt;/script&gt; 
      &lt;script type="text/javascript" src="jquery/js/jquery-ui-1.8.2.custom.min.js"&gt;&lt;/script&gt; 
      &lt;script type="text/javascript"&gt; 
  
          jQuery(document).ready(function(){
              $('#zipsearch').autocomplete({source:'suggest_zip.php', minLength:2});
          });
  
      &lt;/script&gt; 
      &lt;link rel="stylesheet" href="jquery/css/smoothness/jquery-ui-1.8.2.custom.css" /&gt; 
      &lt;style type="text/css"&gt;&lt;!--
  
              /* style the auto-complete response */
              li.ui-menu-item { font-size:12px !important; }
  
      --&gt;&lt;/style&gt; 
  &lt;/head&gt; 
  
  &lt;body&gt; 
  
  &lt;form onsubmit="return false;"&gt; 
      Enter a City:
      &lt;input id="zipsearch" type="text" /&gt; 
  &lt;/form&gt; 
  
  &lt;/body&gt; 
  &lt;/html&gt;
  </code></pre>