Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The jquery selector will always choose the first element of Drupal.settings.form_id, despite fi there is multiple forms in a single page. Do you have a work around to this? Can you find which form_id needs to have an inline message applied to it, then add it to Drupal.settings.inline_message, in which then you can target the correct element?
Comments
Comment #1
Peacog CreditAttribution: Peacog commentedI would love a fix for this too.
While investigating this I came across a flaw in the code logic. The function inline_messages_get_forms() generates a list of modules that implement hook_form() by checking module_implements('form'). This will find modules that have implemented mymodule_form(). It won't find modules that have more than one form with multiple hook_form implementations e.g. mymodule_first_form(), mymodule_second_form() etc.
It seems that the core module_hook() function needs to be cleverer at working out if hook_form has been implemented.
Comment #2
iamjon CreditAttribution: iamjon commentedI thought I had the same problem but in the end it works just fine with the two forms.
In my particular case I didn't finish the validation function as I was supposed to.
Are these custom forms or drupal forms? Can you provide any more info.