I'm working on a module that loads dynamically (AJAX) a Drupal node-form into a div region of the page.
I've managed to get this working successfully (the node can be edited, deleted, etc. and correctly redirected after that to my custom page), but some fields of the form are not working properly. Specifically, the autocomplete (taxonomy tagging) fields are not working as expected. Better said, they are not working at all.
With the firebug console I have checked both node-forms (the regular ones from drupal, in its static pages, and my ajax-loaded node form). In the regular ones, it's working perfectly, as expected (the navigator sends the request and gets its answer), but in my form the navigator is not sending anything to the server whe开发者_如何学编程n I write something on the autocomplete taxonomy field.
Note that I've tried adding manually the (misc/autocomplete.js) file, and the javascript files are all loaded in the same order in my ajax-node-form and in the drupal regular node-form.
Any idea of how can I solve this? I've searched everywhere and tried everything, but obviously not the right solution yet.
Thanks in advance for your help!
Though I am not sure what the exact problem is, you should check that the input form element has the "autocompelete-processed" class. Most likely this is not the case, which means that Drupal.attachBehaviors is not being run on your ajax loaded form...so try to call this function after your form loads.
精彩评论