You can do something like the following these days by referencing the "beforeSubmit" jquery form event. I'm disabling and enabling the submit button to avoid duplicate requests, submitting via ajax, returning a message that's a json array and displaying the information in a pNotify:
jQuery('body').on('beforeSubmit', "#formID", function() {
$('.submitter').prop('disabled', true);
var form = $('#formID');
$.ajax({
url : form.attr('action'),
type : 'post',
data : form.serialize(),
success: function (response)
{
response = jQuery.parseJSON(response);
new PNotify({
text: response.message,
type: response.status,
styling: 'bootstrap3',
delay: 2000,
});
$('.submitter').prop('disabled', false);
},
error : function ()
{
console.log('internal server error');
}
});
});