Jeremy
Newbie
Posts: 1
Registered: 5/23/2005
Member Is Offline
|
| posted on 5/23/2005 at 04:13 PM |
|
|
Dynamically Add Calendars
Hi,
I would like to dynamically add a text field and a calendar. I thought this would be possible using an array cal[x] rather than calx as normal.
So I have:
var cal = new Array(100);
.
.
and in my code to dynamically add fields, "z" is an table cell for instance:
z.innerHTML = "<input type='text' name='training_Date" + x + "'> <a href='javascript:cal[" + x + "].popup();'><img
src='images/cal.gif' align='absmiddle' width='16' height='16' border='0' alt='Click Here to Pick up the date'></a>"
.
.
.
var cal[x] = new calendar1(document.forms['Training'].elements["training_Date" + x]);
cal[x].year_scroll = true;
cal[x].time_comp = false
"x" increasing each time I add a field.
Is this the right approach? Don't seem to work so far! I am finding the "cal[x].popup()" gives an error!
Any thoughts ideas?
Many thanks
Jeremy
|
|
|
|