How to determine calendar id in event handler

I’m using calendars within a form. From within an onChange, or other calendar event, how can I determine the associated input id?

Hello
Here is a little code sample:

formData = [ {type: "calendar", dateFormat: "%d.%m.%Y", serverDateFormat: "%Y-%m-%d", name: "Date1", label: "Date 1", calendarPosition: "right"}, {type: "calendar", dateFormat: "%d.%m.%Y", serverDateFormat: "%Y-%m-%d", name: "Date2", label: "Date 2", calendarPosition: "right"}, {type: "calendar", dateFormat: "%d.%m.%Y", serverDateFormat: "%Y-%m-%d", name: "Date3", label: "Date 3", calendarPosition: "right"}, {type: "calendar", dateFormat: "%d.%m.%Y", serverDateFormat: "%Y-%m-%d", name: "Date4", label: "Date 4", calendarPosition: "right"} ]; myForm = new dhtmlXForm("myForm1", formData); myForm.attachEvent("onChange", function (id, value){ console.log("ID of calendar is "+id) });

Thanks! How does on determine what parameters are available to be passed to an event handler, such as “onChange”?

Actually, for “input” types the event docs for forms shows:

myForm.attachEvent(“onChange”, function (name, value){
//your code here
});

What was not clear was that this applied for “calendar” type as well. It seems that “calendar” is really just an extended “input” with the additional properties to provide the popup calendar and to filter keyboard input to valid dates.

Yes, you are right. Something like this. Plus ID of form item is a parameter “name” as you already know