Hi,
I’m struggling on a JS function to generate calendars.
It works fine until I have more than one instance. Then, when I change the month in the first instance, it’s the 2nd one which makes the change.
I don’t understand very well how I should build my function.
Can you tell me what I have to do in order to get the methods applied to the right instance?
Here after is a brief extract from the way I built my function (I spare you the 500 lines).
[CODE]
function calendar(FieldId)
{
var me = this;
me.SelectedDays = Array();
//etc
GoNextMonth = function(){
//blabla
}
me.NextMonthButton = document.createElement(‘div’);
me.NextMonthButton.onclick=GoNextMonth();
}
PS: I use the word ‘instance’ but my function is not a class, I call it using [I]calendar(‘test’)[I]new calendar(‘test’)
Cheers!