Hi,
I have some code that creates calendar objects the problem is that I want the links to the calander stored in a table populated dynamically (using a while loop). The code below shows the field that creates the link button and text field that the date goes into. Basically when the user clicks on the link it brings up a calendar in another window. The user can pick a date and this is put in the textfield.
The "call" in the javascript is a calendar object called "call".
It uses 'form' & 'text' which are the names of the form and the textfield. I need it to create a different calendar object for each row. At the moment I get an error that says "Error 'document.forms.form.elements.text' is null or not an object". Both links open the same calendar object and it just populates the first textfield in the table.
The image shows what is going on.
Does anyone know how I can fix this problem so that I can have as many or little calendar objects in the table.
Any help would be great
Cheers
Rob
I have some code that creates calendar objects the problem is that I want the links to the calander stored in a table populated dynamically (using a while loop). The code below shows the field that creates the link button and text field that the date goes into. Basically when the user clicks on the link it brings up a calendar in another window. The user can pick a date and this is put in the textfield.
Code:
<td><form name=\"form\"><span class=\"style2\"> <input type=\"Text\" name=\"text\" value=\"\"><a href=\"javascript:call.popup();\"><img src=\"images/cal.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"Click Here to Pick up the date\"></a> </span></form></td>
The "call" in the javascript is a calendar object called "call".
Code:
<script language=\"JavaScript\">
var call = new calendar1(document.forms['form'].elements['text']);
call.year_scroll = true;
call.time_comp = false;
</script>
It uses 'form' & 'text' which are the names of the form and the textfield. I need it to create a different calendar object for each row. At the moment I get an error that says "Error 'document.forms.form.elements.text' is null or not an object". Both links open the same calendar object and it just populates the first textfield in the table.
The image shows what is going on.

Does anyone know how I can fix this problem so that I can have as many or little calendar objects in the table.
Any help would be great
Cheers
Rob