Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-16-2007, 03:14 PM   PM User | #1
mariya
New Coder

 
Join Date: Apr 2007
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
mariya is an unknown quantity at this point
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
mariya is offline   Reply With Quote
Old 04-18-2007, 03:43 PM   PM User | #2
javascriptbank
New Coder

 
Join Date: Nov 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
javascriptbank is an unknown quantity at this point
I tested it. It's working correctly.
__________________
www.JavaScriptBank.com - Largest and Greatest Javascript library in Vietnam
javascriptbank is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:58 PM.


Advertisement
Log in to turn off these ads.