Skip to content
Advertisement

Get ‘Nan’ when auto calculate

I am creating a form using Gridview in ASP.NET. When the user fills in Qty and Price it needs to automatically calculate the Total. However, my Total always returns Nan (Not a number). What am I doing wrong?

The ASP page looks like this:

JavaScript

The JavaScript:

JavaScript

Advertisement

Answer

JavaScript

why are you using isNan and parseInt at the same time ?

i think is should be :

JavaScript

which returns true if val = string and false if number

another one.. you only need to parseInt if you will use their value in a formula ..

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement