jQuery(document).ready(function(){
  jQuery('#subscribe-form').on('submit',function(e) {  //Don't foget to change the id form
  jQuery.ajax({
      url:'subs.php', //===PHP file name====
      data:jQuery(this).serialize(),
      type:'POST',
      success:function(data){
        //Success Message == 'Title', 'Message body', Last one leave as it is
	      swal({
              title: "Thank You!",
              text: "Your subscrition request has been submitted successfully.",
              icon: "success",
              showCancelButton: false,
             showConfirmButton: false,
            timer: 4000
           }).then(function() {
            jQuery('#subscribe-form')[0].reset();
                   });

      },
      error:function(data){
        //Error Message == 'Title', 'Message body', Last one leave as it is

         swal({
              title: "Oops...",
              text: "Something went wrong :(",
               icon: "error",
             timer: 4000
           });
      }
    });
    e.preventDefault(); //This is to Avoid Page Refresh and Fire the Event "Click"
  });
});