title: form submission in struts1 using javascript
body: <p>I am trying to submit  using javascript . Since I was not able to find  using "document.forms" so i used "document.getElementById" but now i am not able to assign action class to it .Can someone help me on this .</p>
  
  <p>My code :</p>
  
  <pre><code>&lt;html&gt;
  
  &lt;head&gt;
  just to check javascript form submission
  &lt;/head&gt;
  
  &lt;body&gt;
  
  &lt;script&gt;
  
  function formsubmission(value){
  alert("i am here just before the form submission"+value);
  document.forms["ashutosh"].submit();
  alert("i am just after the form submission");
  }
  
  &lt;/script&gt;
  
  &lt;form id="ashutosh" action="http://www.gmail.com"&gt;
  &lt;select onchange="javascript:formsubmission(this.formName)"&gt;
  &lt;option value="1"&gt;ashutosh&lt;/option&gt;
  &lt;option value="2"&gt;ashutosh1&lt;/option&gt;
  &lt;option value="3"&gt;ashutosh2&lt;/option&gt;
  &lt;/select&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  
  
  &lt;/html&gt;
  </code></pre>
  
  <p>Error :</p>
  
  <pre><code>Object #&lt;HTMLElement&gt; has no method 'submit'
  </code></pre>