Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Apr 2007
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    problem with functions that adds input fields

    hi all,

    I am having some trouble with a function that adds up 10 values and sees whether the sum is 100. It does not seem to add correctly, can you possibly help?


    function doesAddUp(field1, field2, field3, field4,
    field5, field6, field7, field8, field9, field10)
    {

    if (field1 + field2 + field3 + field4 + field5 + field6 + field7 + field8 + field9 + field10 != 100)
    { err = "Your total is not 100";}
    else {err = false;}
    return err;
    }


    Many many thanks!
    mariya

  • #2
    New Coder
    Join Date
    Nov 2005
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I tested it. It's working correctly.
    www.JavaScriptBank.com - Largest and Greatest Javascript library in Vietnam


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •