<form ......... onsubmit="submitHandler(event)">
function submitHandler(event){
event.preventDefault();
form = event.target;
fetch(form.getAttribute("php"), {
method: "POST",
body: new FormData(form)
})
.then(response => response.json())
.then(function(json) { console.log(json); })
.catch(function(error) { console.log(error); });
}