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

Peacog’s picture

Title: Targets first element of Drupal.settings.form_id » Doesn't work if more than 1 form on a page

I 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.

iamjon’s picture

I 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.