title: submit a form via Ajax using prototype and update a result div
body: <p>I'm wondering how can I submit a form via Ajax (using prototype framework) and display the server response in a "result" div.
  The html looks like this :</p>
  
  <pre><code>&lt;form id="myForm" action="/getResults"&gt;
      [...]
      &lt;input type="submit" value="submit" /&gt;
  &lt;/form&gt;
  &lt;div id="result"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>I tried to attach a javascript function (which uses Ajax.Updater) to "onsubmit" (on the form) and "onclick" (on the input) but the form is still "non-Ajax" submitted after the function ends (so the whole page is replaced by the results).</p>