title: Run PHP code after button click but without refreshing page
body: <p>I have a form in HTML to apply a Discount Coupon to a current shopping cart.
  I would like the user to just click on APPLY (after entering the coupon code) and then without refreshing the page, to have some PHP code run so it computes the corresponding discount.</p>
  
  <p>Here is my form:</p>
  
  <pre><code>&lt;form action=""&gt;
     &lt;input type="text" name="couponCode"&gt;
     &lt;input type="submit" value="Apply"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>PHP to be run:</p>
  
  <pre><code>if (isset($_REQUEST['couponCode']) &amp;&amp; $_REQUEST['couponCode']!='') 
  {
   $couponCode = $_REQUEST['couponCode'];
      if ($couponCode == "TEST1") 
      {
      $discount=0.2;
      }
  }
  </code></pre>
  
  <p>How would this be done using javascript?</p>