Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: Creating a Loop for multiple calendars
ckl
Newbie

Posts: 1
Registered: 8/3/2004
Member Is Offline
posted on 8/3/2004 at 07:52 PM Reply With Quote
Creating a Loop for multiple calendars


I am trying to create a loop to create multiple calendars 25+

The only section of code I am having trouble with it that below the form tag
I currently have 3 calenders working with the follwing code :

<script language="JavaScript">

var cal1000 = new calendar2(document.forms['frmNew'].elements[ecdt1000]);
var cal1001 = new calendar2(document.forms['frmNew'].elements[ecdt1001]);
var cal1002 = new calendar2(document.forms['frmNew'].elements[ecdt1002]);

</script>


Above is expandable to infine number of calenders, but impracticle. I am using a database value to control the number of loop iterations


My attempt is below. The error I assume is in the second line starting with var calname...
(the alert allows me to verify the variables are correctly incrementing)

<script language="JavaScript">

for (i = 1000; i <= 1002; i++)
{
var calname = "cal" + i;
var inputname = "ecdt" + i;
alert("Name: " + calname + " inputname: " + inputname)
var calname = new calendar2(document.forms['frmNew'].elements[inputname]);
}
</script>

I need to be able to "declare/create" a new calendar and set the name to my variable 'calname' . The 'inputname' variable is working correctly - i have trested this in substitution with the code above. Any help would be appreciated - my javascript is rusty.

Thanks,
CKL
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Product Page
Product Demonstrations Live Demos
Free Download Free Download
Product Documentation Documentation
Support Forum Support Forum
 

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004