title: Posting values in multiple forms separately with single function
body: <p>I have a task with a form that requests posting values in multiple forms separately by getting field values, all with single event function applied at each form submit call, so there could be multiple forms on page with same identifiers.
  Please review this working example that handles only values of first field and suggest something in generic javascript if possible.</p>
  
  <pre><code>&lt;script&gt;
      function Order() {
          var formi=document.getElementById("test").value;
          document.getElementById("result").value=document.getElementById("test").value;
          alert(formi);
      }
  &lt;/script&gt;
  
  &lt;form onsubmit="Order();return false;"&gt;
  &lt;input type="text" id="test" value=""&gt;
  &lt;input type="text" id="result" value=""&gt;
  &lt;input type="submit" value="Order"&gt;
  &lt;/form&gt;
  
  &lt;form onsubmit="Order();return false;"&gt;
  &lt;input type="text" id="test" value=""&gt;
  &lt;input type="text" id="result" value=""&gt;
  &lt;input type="submit" value="Order"&gt;
  &lt;/form&gt;
  </code></pre>