|
-
Oct 4th, 2002, 02:14 AM
#1
Thread Starter
Frenzied Member
Calling af function in JS with FOR
I have a number of functions names saet_dim1(), saet_dim2() ... saet_dim10(). How can I cal this function depending on a FOR?
I have tried this:
Code:
for (j=1;j<11;j++){
saet_dim' +j '();
}
but with no luck
-
Oct 4th, 2002, 03:04 AM
#2
Fanatic Member
cant you create one function and pass a parameter to it?
Code:
for (j=1;j<11;j++){
saet_dim(j);
}
Then in the function update Dim1? Unless this is not what you're trying to achieve...
-
Oct 4th, 2002, 04:01 AM
#3
Thread Starter
Frenzied Member
Hi Punkie
Of course you're right, that would be the best solution, but the functions I need, are not build up like that, and they are very complicated to change. So I need to do it the other way, somehow like you showed me some time ago for elements:
Code:
document.test.elements('test'+i).value=5;
-
Oct 4th, 2002, 07:39 AM
#4
try this
Code:
for(i=0;i<2;i++)
eval('saet_dim'+i+'()');
the eval function has some security and speed issues that
you might want to check out first
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|