I'm using the field_collection module. A collection has a "custom field" I've created, which rely on a jQuery plugin. When I add another item in my collection, the jQuery plugin is no more invoked, and the field doesn't work anymore.

At the first load, all is working, it's only after adding a new item.

I don't know how to invoke the jQuery plugin initialization, there is probably something with the ajax command "field_add_more_js", but I can't figure out which hook or which solution I can use :(

Do you have any idea ? many thanks

1 Answer 1


Actually, it was quite simple... I use Drupal.behaviors to attach my jQuery plugin initialization to the form, and it's now called on ajax callback as well, when a part of the form is updated by this ajax call. So it's fixed !

The drupal documentation helped me, and the Lullabot article as well !

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.