edyoung
-
Total Posts
:
3
- Scores: 0
-
Reward points
:
0
- Joined: 1/13/2011
-
Status: offline
|
need help with simple statement
Thursday, January 13, 2011 7:26 AM
( permalink)
I put a test alert message in a script...the alert triggers 7 times. The code just looks at 7 user inserted items and adds them together and places the total into a field (I removed the last part for this test). function mistot(){ var ep = document.forms[0].elements; var myamt = 'm-amt'; var mytot = 0; for(var i=1; i<=8; ++1) { if(isFloat(ep[myamt=i].value)) { mytot += +ep[myamt+i].value; } alert('test'); } } The alert message triggers 7 times because it is inside my "for" statement. However if I place the alert after the for statement...it does not trigger at all. What is wrong with my statment? <snip>---- mytot += +ep[myamt+i].value; } } alert('test'); }
|
|
|
|
ebgreen
-
Total Posts
:
8227
- Scores: 98
-
Reward points
:
0
- Joined: 7/12/2005
-
Status: offline
|
Re:need help with simple statement
Thursday, January 13, 2011 7:36 AM
( permalink)
Well I would start with the fact that your code is not VBScript.
|
|
|
|
edyoung
-
Total Posts
:
3
- Scores: 0
-
Reward points
:
0
- Joined: 1/13/2011
-
Status: offline
|
Re:need help with simple statement
Thursday, January 13, 2011 8:03 AM
( permalink)
oops...
|
|
|
|