The script I've put into the head is :
<script language="Javas cript">
var calnew = new Array();
function myfun(index){
calnew[index] = new calendar1(docum ent.forms['myform'].elements['txtTaskStartDa te1']);
calnew[index].year_scroll = true;
calnew[index].time_comp = false;
};
</script>
Then I have a button on the page that onClick ="return
btnNew_onclick( 'People')"
where btnNew_onclick( 'People') calls a function in an include file (to
create the new fields) the last line of the function being
myfun(temp); where temp is the number of the object eg cal7. The field
is created along with the calender button with the correct hyperlink
but when this is clicked an error cal7 is undefined occurs.
What do you think I'm doing wrong??
Thanks.
in*********@cli ffhanger.com (Mike Jones) wrote in message news:<8c******* *************** ****@posting.go ogle.com>...
How about using an array:
var cal = new Array();
function someFunction(in dex) {
cal[index] = new calendar1(etc.. .)
cal[index].year_scroll = true
}
jo*******@eirco m.net (Secondpost) wrote in message news:<25******* *************** ****@posting.go ogle.com>... I need to use a calender object with a dynamic form i.e. when a new
row of fields is created using Javascript a calender button appears
aswell. The problem is if I need to declare the following code for the
calendar script to work:
var cal6 = new calendar1(docum ent.forms['formname'].elements['fieldname']);
cal6.year_scrol l = true;
cal6.time_comp = false;
where the # 6 will change as the user adds a new field (by clicking a
button).
My problem is that the code doesn't seem to execute during run-time.
If I add the code to the include file after the field is created it
still doesn't recognise that the calendar objects exists. Can anyone
help??