your formatting is messed up and caused you to exit the function fixOrder before it really did anything:
function fixOrder() {
var numPrice = parseFloat(document.getElementById("cost").value);
var taxP = parseFloat(document.getElementById("tax").value);
var total = parseFloat(document.getElementById("total").value);
if (isNaN(numPrice)) {
alert("Sorry,you must enter a numeric value to place order");
return; //gets syntax error
}
if (isNaN(taxP)) {
alert("Sorry, you must enter a numeric tax value to continue");
return;
}
var tax = (numPrice * taxP) / 100;
var total = numPrice + tax;
numPrice = 0;
taxP = 0;
document.getElementById("total").value = "$" + total.toFixed(2);
return; //gets syntax error
}
See how much easier to read that is? Where you original code could be reduced to :
document.getElementById("total").value = "$NaN";