My code is not branching as expected. In the code below after the confirm message if the user click "OK" the branching does take the true route. But then it continues to the false route. Why would that occur?
Code:
okToAdd = false
var cReset = confirm("Your ending odometer reading is less than your start. \n Press OK to change or \n Cancel to set both start and end miles to blank!");
if (cReset == true)
{
document.getElementById(cEnd).select();
document.getElementById(cEnd).focus();
return false;
}else{
document.getElementById(cStart).value = "";
document.getElementById(cEnd).value = "";
document.getElementById(cStart).focus();
return false;
}
Comment