title: how to invoke a jsp method onclick/on form submit
body: <p>I have a jsp page with this code:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function getWithdrawAmmount()
  {
  var withdraw=document.forms["WithdrawDeposit"]["AmountToWithdraw"].value;
  document.getElementById('hidden').type = withdraw;
  }
  &lt;/script&gt;
  </code></pre>
  
  <hr>
  
  <pre><code>&lt;form method="POST" name="WithdrawDeposit" onsubmit="getWithdrawAmmount()"&gt;
  &lt;table&gt;
  &lt;tr&gt;&lt;td&gt;&lt;input type="text" size=5 name="AmountToWithdraw"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="button" value="Withdraw"&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;
  &lt;/form&gt;
  &lt;input type="hidden" name="hidden" value=""&gt;
  </code></pre>
  
  <hr>
  
  <pre><code>&lt;% String AmountWithdraw = request.getParameter("hidden");  %&gt;
  &lt;%!
  public void Withdraw(){     
      int Amount = Integer.parseInt("AmountWithdraw");
  Deposit deposit = new Deposit();
  deposit.WithdrawMoney(AmountWithdraw);  
  } %&gt;
  </code></pre>
  
  <hr>
  
  <p>I need to activate the Withdraw() method on form submit and get the text input.
  the javascript hold the value inserted in 'hidden' and i can access it later.
  but i can't call to : &lt;% Withdraw(); %> from inside javascript. </p>
  
  <p>how can i call Withdraw() after button click?</p>
  
  <p>10x</p>