//Set your form action
document.getElementById('myFormId').action="./myPage.myLanguage"
//display on console your form action
connsole.log(document.getElementById('myFormId').action)
//retrive the action from a selected Form
document.getElementById('myFormId').action
<!--Answer from W3 Schools-->
<form action="/action_page.php">
<label for="username">Username:</label>
<input type="text" id="username" name="username" required>
<input type="submit">
</form>
A form action set to a JavaScript function is not widely supported, I'm surprised it works in FireFox.
The best is to just set form action to your PHP script; if you need to do anything before submission you can just add to onsubmit
Edit turned out you didn't need any extra function, just a small change here:
function validateFormOnSubmit(theForm) {
var reason = "";
reason += validateName(theForm.name);
reason += validatePhone(theForm.phone);
reason += validateEmail(theForm.emaile);
if (reason != "") {
alert("Some fields need correction:
" + reason);
} else {
simpleCart.checkout();
}
return false;
}