Howto attach Calendar to an ajax loaded input-field

Hello!
Perhaps someone can help me with this. I do load some html-code via ajax. After successful loading i tried to attach an calendarobject to one of the loaded fields, but dhtmlxCalendar cannot find it (Error-Console says: wCal.con[0] is null).
Is there a way to attach it correctly?

Here’s some example code. The attach-function works well on a field that is there from startup:

[code]

New Calendar[/code]

Hello,

there is a typo in your code. There must be

attach(‘calInput’);

instead of

attach(‘callInput’);

Thank you, i just typed it into the posting without testing it again :nerd:
Any suggestion about the problem?

Hello,

the provided code works correctly (with attach(‘calInput’)).

Hi!

Perhaps i should add some html code to show where my problem ist:

<div id="test"></div> <button onclick="create()">New Calendar</button>

After clicking the button a new input-field appears. Reading the function attach() this new input-field should have an attached calendar–ibject now. But clicking into the new input-field only generates the “no object” error. I tested it in ie and firefox - both ended with the same error.

Hi,

please provide the complete demo with all necesasry libraries to recreate the problem.

Hello!
I’m just a lousy programmer. You’re right, it was just a damn little typo error :blush:
Now the calendar works fine and i’m happy.

Thank you very much for your patient and the help you provided to me.

Best Regards
Nigatol

[Topic can be closed]