When I press enter I get isNaN, but the value is a number

后端 未结 3 699
梦毁少年i
梦毁少年i 2020-12-12 03:32

This is a problem that I don\'t understand because all the code validates. It\'s my homework that\'s due tonight at Midnight.

When I enter a value into the \'Price\

3条回答
  •  心在旅途
    2020-12-12 04:15

    I think you forget to close your { and }, and you should return to avoid calculating.

    if (isNaN(numPrice)) { 
        alert("Sorry,you must enter a numeric value to place order");
        return;
    }
    
    if (isNaN(taxP)) {
        alert("Sorry, you must enter a numeric tax value to continue");
        return;
    }
    

提交回复
热议问题