3 Replies Latest reply on Nov 27, 2009 1:48 PM by Xeuce

    NaN problems

    Xeuce

      This is what I have at the moment.

       

      count = (Number(QTY01))+(Number(QTY02))+(Number(QTY03))+(Number(QTY04))+(Number(QTY05))+(Number(Q TY06))+(Number(QTY07))+(Number(QTY08))+(Number(QTY09))+(Number(QTY10))+(Number(QTY11))+(Nu mber(QTY12))+(Number(QTY13))+(Number(QTY14))+(Number(QTY15))+(Number(QTY16))+(Number(QTY17 ))+(Number(QTY18))+(Number(QTY19))+(Number(QTY20))+(Number(QTY21))+(Number(QTY22))+(Number (QTY23))+(Number(QTY24))+(Number(QTY25));

       

      if (QTY01 ="") {

      QTY01 = "0";

      }

      if (QTY02 =="") {

      QTY02 = "0";

      }

      if (QTY03 =="") {

      QTY03 = "0";

      }

      if (QTY04 =="") {

      QTY04 = "0";

      }

      if (QTY05 =="") {

      QTY05 = "0";

      }

      if (QTY06 =="") {

      QTY06 = "0";

      }

      if (QTY07 =="") {

      QTY07 = "0";

      }

      if (QTY08 =="") {

      QTY08 = "0";

      }

      if (QTY09 =="") {

      QTY09 = "0";

      }

      if (QTY10 =="") {

      QTY10 = "0";

      }

      if (QTY11 =="") {

      QTY11 = "0";

      }

      if (QTY12 =="") {

      QTY12 = "0";

      }

      if (QTY13 =="") {

      QTY13 = "0";

      }

      if (QTY14 =="") {

      QTY14 = "0";

      }

      if (QTY15 =="") {

      QTY15 = "0";

      }

      if (QTY16 =="") {

      QTY16 = "0";

      }

      if (QTY17 =="") {

      QTY17 = "0";

      }

      if (QTY18 =="") {

      QTY18 = "0";

      }

      if (QTY19 =="") {

      QTY19 = "0";

      }

      if (QTY20 =="") {

      QTY20 = "0";

      }

      if (QTY21 =="") {

      QTY21 = "0";

      }

      if (QTY22 =="") {

      QTY22 = "0";

      }

      if (QTY23 =="") {

      QTY23 = "0";

      }

      if (QTY24 =="") {

      QTY24 = "0";

      }

      if (QTY25 =="") {

      QTY25 = "0";

      }

      Price01 ="3.50";

       

      Price02 ="4.00";

       

      Price03 = "4.0";

       

      Price04 = "8.50";

       

      Price05 = "8.50";

       

      Price06 = "8.50";

       

      Price07 = "8.50";

       

      Price08 = "8.50";

       

      Price09 = "8.50";

       

      Price10 = "12.50";

       

      Price11 = "10.00";

       

      Price12 = "7.50";

       

      Price13 = "7.50";

       

      Price14 = "7.50";

       

      Price15 = "13.00";

       

      Price16 = "13.00";

       

      Price17 = "15.00";

       

      Price18 = "15.00";

       

      Price19 = "15.00";

       

      Price20 = "7.50";

       

      Price21 = "7.50";

       

      Price22 = "12.50";

       

      Price23 = "12.00";

       

      Price24 = "12.00";

       

      Price25 = "12.00";

       

      Total01 = (Number(QTY01))*(Number(Price01));

      Total02 = (Number(QTY02))*(Number(Price02));

      Total03 = (Number(QTY03))*(Number(Price03));

      Total04 = (Number(QTY04))*(Number(Price04));

      Total05 = (Number(QTY05))*(Number(Price05));

      Total06 = (Number(QTY06))*(Number(Price06));

      Total07 = (Number(QTY07))*(Number(Price07));

      Total08 = (Number(QTY08))*(Number(Price08));

      Total09 = (Number(QTY09))*(Number(Price09));

      Total10 = (Number(QTY10))*(Number(Price10));

      Total11 = (Number(QTY11))*(Number(Price11));

      Total12 = (Number(QTY12))*(Number(Price12));

      Total13 = (Number(QTY13))*(Number(Price13));

      Total14 = (Number(QTY14))*(Number(Price14));

      Total15 = (Number(QTY15))*(Number(Price15));

      Total16 = (Number(QTY16))*(Number(Price16));

      Total17 = (Number(QTY17))*(Number(Price17));

      Total18 = (Number(QTY18))*(Number(Price18));

      Total19 = (Number(QTY19))*(Number(Price19));

      Total20 = (Number(QTY20))*(Number(Price20));

      Total21 = (Number(QTY21))*(Number(Price21));

      Total22 = (Number(QTY22))*(Number(Price22));

      Total23 = (Number(QTY23))*(Number(Price23));

      Total24 = (Number(QTY24))*(Number(Price24));

      Total25 = (Number(QTY25))*(Number(Price25));

      trace(QTY02);

       

      Subtotal = (Number(Total01))+(Number(Total02))+(Number(Total03))+(Number(Total04))+(Number(Total05)) ;

      Tax = (Number(Subtotal))* 0.07;

      Damage = (Number(Subtotal))* 0.08;

      Total = (Number(Tax))+(Number(Subtotal))+(Number(Damage));

       

      trying to create an order form

      where (QTY)*(Price)=(Total)

      I want my QTY to start off as 0, and user can change it accordingly

      I want my Total to be 0 until QTY is changed, then calculated appropriately

       

      Currently... My quantity fields show up blank, and my total comes up as NaN, how do I fix this?