Alert for button submission

Apologize for the amount of code. Far from me the intent to scare you away.

So, what I did was to add your code together in the head, like this:

<script>
$("#subscribe_button").on("click", function(e){
  e.preventDefault();
  var address = $("#email_address").val();
  if (!/\S+@\S+\.\S+/.test(address)){
    alert("Email address not valid!");
  } else {
    subscribeToNewsletter(address);
    $("#email_address").val("")
  }
});
function subscribeToNewsletter(address){
  $.ajax({
    url: 'mailcontadinobio.php',
    type: 'POST',
    data: {email: address}
  })
  .success(function(message) {
    alert(message);
  })
  .fail(function() {
    alert("There was a problem. Please try again later.");
  });
}
</script> 

I’ve naturally changed some ids. You can see the result online clicking on the link in my first post.