title: redirect to another page using onsubmit or action?
body: <p>I am trying to direct to another page on particular event occurrence ...This is my code..but it does not direct to another page but the JavaScript code works...</p>
  
  <pre><code>&lt;form class="list-group-item"  method="get" onsubmit="action='Search.jsp'; myFunction('name');return false;"  &gt;
    &lt;input type="hidden" name="item" value="&lt;%=1%&gt;"&gt; 
    &lt;i class="fa fa-arrow-circle-right fa-fw "&gt;&lt;/i&gt; &lt;span onsubmit="action='Search.jsp'" onclick="action='Search.jsp';document.getElementById('div1').style.display = 'block';setValue('Subject')"  style="margin-left:1%"&gt;Subject &lt;/span&gt;    
    &lt;span class=" text-muted small"  onclick="document.getElementById('div1').style.display = 'block';setValue('Subject And')"  style="margin-left:40%"&gt;&lt;em&gt; And &lt;i class="fa  fa-angle-down "&gt;&lt;/i&gt;&lt;/em&gt;
    &lt;/span&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>First I tried action="search.jsp" outside onsubmit but that didn't work..I am new to all this and I don't know what to do?</p>