title: How to stay in same page after submit form
body: <p>I'm currently creating a subscription form using jQuery. My problem is I want to make this form stay in the same page after user click "SUBSCRIBE" button and when the process is successful, the text on button "SUBSCRIBE" change to "SUBSCRIBED". </p>
  
  <p>Below is the code :</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;form action="http://bafe.my/sendy/subscribe" class="subcribe-form" accept-charset="UTF-8" data-remote="true" method="post"&gt;
      &lt;input type="hidden" name="authenticity_token" /&gt;
      &lt;input type="hidden" name="list" value="ttx7KjWYuptF763m4m892aI59A" /&gt;
      &lt;input type="hidden" name="name" value="Landing" /&gt;
      &lt;div class="form-group"&gt;
          &lt;div class="input-group"&gt;
              &lt;input type="email" name="email" class="form-control" placeholder="Masukkan email anda" /&gt;
              &lt;span class="input-group-btn"&gt;&lt;button type="submit" class="btn btn-primary"&gt;SUBSCRIBE&lt;i class="fa fa-send fa-fw"&gt;&lt;/i&gt;&lt;/button&gt;&lt;/span&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>jQuery:</p>
  
  <pre><code>$(".subcribe-form").submit(function(){
      var validEmail = true;
      $("input.form-control").each(function(){
          if ($.trim($(this).val()).length == 0){
              $(this).addClass("has-error");
              validEmail = false;
          } else{
              $(this).removeClass("has-error");
          }
      });
      if (!validEmail) alert("Please enter your email to subscribe");
      return validEmail;
  });
  </code></pre>