title: Javascript Submit Back to Form
body: <p>I am building a search by city function. Once you have typed in the search field, and if there are multiple cities, you are then presented with all the options. 
  Each option is a link with javascript, which when clicked should input the value (zipcode) back into the form for processing. The error I am getting is this:</p>
  
  <p>Uncaught TypeError: Cannot call method 'submit' of undefined</p>
  
  <p>Here is my javascript (yep Im using smarty):</p>
  
  <pre><code>&lt;a href= "#" onclick="document['myform'].submit({$row.Zipcode}); return false"&gt;{$row.City}, {$row.State} {$row.Zipcode}&lt;/a&gt;
  </code></pre>
  
  <p>Here is my form:</p>
  
  <pre><code>&lt;form action="mymethod.php" method="POST" id="myform"&gt;
  </code></pre>
  
  <p>As you can see I am trying to pass the zipcode back to the form for processing upon 'click'
  Appreciate any insight anyone cares to share</p>