Go Back   Webmaster Malaysia Forum » Website Design & Development » Website Design

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-05-2005, 11:28 AM
Novice Webmaster
 
Join Date: Feb 2003
Location: JB
Posts: 26
Rep Power: 0
koisempoi is on a distinguished road
Send a message via Yahoo to koisempoi
Total form looping textfield

Code:
function hazardL ()
{
var eq = new Array  ();
var price = new Array  ();
var hz = new Array  ();
for (b=1;b<=19;b++) {
eq[b] = parseFloat(document.form1['e'+b+''].value);
price[b] = parseFloat(document.form1['lp'+b+''].value);
hz[b] = eq[b] * price[b]; 
document.form1['hzL'+b+''].value = hz[b].toFixed(2);  
a += hz[b]; //This is the problem

document.form1.sbA.value = a.toFixed(2);
}

from this loop, i want to add all the hz[b] total for example hz[1] + hz[2] untill hz[19]. can anyone show me what's wrong with the code ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-05-2005, 12:37 PM
Inspired Webmaster
 
Join Date: Feb 2004
Location: Shah Alam
Posts: 175
Rep Power: 59
hftey is on a distinguished road
Send a message via ICQ to hftey Send a message via MSN to hftey Send a message via Yahoo to hftey Send a message via Skype™ to hftey
Quote:
Originally Posted by koisempoi
Code:
function hazardL ()
{
var eq = new Array  ();
var price = new Array  ();
var hz = new Array  ();
for (b=1;b<=19;b++) {
eq[b] = parseFloat(document.form1['e'+b+''].value);
price[b] = parseFloat(document.form1['lp'+b+''].value);
hz[b] = eq[b] * price[b]; 
document.form1['hzL'+b+''].value = hz[b].toFixed(2);  
a += hz[b]; //This is the problem

document.form1.sbA.value = a.toFixed(2);
}

from this loop, i want to add all the hz[b] total for example hz[1] + hz[2] untill hz[19]. can anyone show me what's wrong with the code ?

i donno += is a valid JS syntax... try a = a + hz[b]
__________________
Venzon Solution Services
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 09-05-2005, 12:35 PM
Novice Webmaster
 
Join Date: Feb 2003
Location: JB
Posts: 26
Rep Power: 0
koisempoi is on a distinguished road
Send a message via Yahoo to koisempoi
Tq

Yes, thank you. it solve my problem
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes 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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Total newbie here >_< Pip_X Website Programming 2 12-04-2006 01:12 PM
Count total of records jeb23 Website Programming 17 04-02-2004 07:15 PM
PHP FrameWork For TOTAL NEWBIE bazet Website Programming 13 02-12-2002 04:19 PM
looping the soundzz min_ah Website Design 19 13-05-2002 09:42 AM
looping problem in IE ? kelly001 Website Design 1 01-05-2002 12:25 AM



All times are GMT +8. The time now is 07:46 PM. Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.


WebmasterMalaysia.com is Proudly Hosted by Exabytes Semi Dedicated Server.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59