If you use jQuery, you can do:
$('#your_form_id').submit(function(e){ e.preventDefault();
You can also do this without a border:
document.getElementById('your_form_id').addEventListener('submit' function() {
In the section // your staff, you can write your ajax code.
source share