Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 665
  • Last Modified:

NaN problem

When I type values, and not all fields are filled in it gives me NaN.

How to remove?

<script>
function test()
{

A=eval(document.calc2.A.value);
B=eval(document.calc2.B.value);
C=eval(document.calc2.C.value);

document.calc2.D.value=parseInt(A + B + C);
document.calc2.E.value=parseInt(A*0.45);

}
</script>
0
Milcoi
Asked:
Milcoi
1 Solution
 
BatalfCommented:
Try

<script>
function test()
{

A=document.calc2.A.value/1+0;
B=document.calc2.B.value/1+0;
C=document.calc2.C.value/1+0;

document.calc2.D.value=parseInt(A + B + C);
document.calc2.E.value=parseInt(A*0.45);

}
</script>
0
 
MilcoiAuthor Commented:
Perfect!!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now