dbg
Newbie
Posts: 1
Registered: 10/2/2009
Location: London
Member Is Offline
|
| posted on 10/2/2009 at 11:00 AM |
|
|
2 dates on one form how can I update 2nd when first changes?
Hello
I have managed to dynamically generate two date calendars on a single form (see script below) What I want to do is have the 2nd date copy the 1st date
whenever the 1st date is updated.
I initially set the dates with PHP variables.
Excerpt from my script that is run from body onload call
/*Needs form with input id=date1 contained in container div and input date2 in container1 div
*/
var N_CALNUM = 1;
function f_createContent() {
var e_div = f_getElement('container');
e_div.innerHTML += '<img title="Open Calendar" class="tcalIcon" onclick="A_TCALS['myCalID' + N_CALNUM + ''].f_toggle()"
id="tcalico_myCalID' + N_CALNUM + '" src="img/cal.gif"/><br />';
new tcal ({
// input name ID
'controlname': 'date1',
// set unique ID to identify the elements
'id': 'myCalID' + N_CALNUM
});
N_CALNUM++;
var e_div1 = f_getElement('container1');
e_div1.innerHTML += '<img title="Open Calendar" class="tcalIcon" onclick="A_TCALS['myCalID' + N_CALNUM + ''].f_toggle()"
id="tcalico_myCalID' + N_CALNUM + '" src="img/cal.gif"/><br />';
new tcal ({
// input name ID
'controlname': 'date2',
// set unique ID to identify the elements
'id': 'myCalID' + N_CALNUM
});
}
|
|
|
|