on submit prevent default code example
Example 1: js stop form submit
<button type="submit" onclick="submitButtonClick(event)">Submit</button>
<script>
function submitButtonClick(event) {
event.preventDefault();
//other stuff you want to do instead...
}
</script>
Example 2: event preventdefault
event.preventDefault()
Example 3: input submit prevent default
$("#cpa-form").submit(function(e){
return false;
});