I'm loading a form using AJAX commands. However, it seems to me that forms loaded with AJAX can't submit using AJAX.
This is what i do :
- Load a form through an ajaxified link. The link invokes a path which maps to a callback function responsible for returning an ajax commands array. This works fine, and the form is loaded onto the page just where it should be.
- I go through the form, and click on submit. The form the submits the page, and the form appears to not have been ajaxified at all.
There is one thing that i suspect may be part of the trouble. It seems to me that not all required JS files are loaded after the commands array have updated the page with the form.
In other words, the number of JS files are not the same if i show the form directly and if i load the form using ajax. If i show the form directly, then the form gets perfectly ajaxfied, whereas if i load the form using ajax it does not get ajaxified.
I've had a look at the Drupal examples module, but haven't found an example which demonstrates this particular case.