When there are 2 forms (or more) that have validation setup, the messages are displayed above the 1st form.

This is because of the check for the main error messages div also matches the div for the specific form. This can be fixed by adding ":not(.clientside-error)" to the selector... however I'm not sure why you'd use the main error message div as in some cases it may not be close to the actual form.

Comments

attiks’s picture

Title: Badly placed error messages with multiple forms » Control placement of error container
Category: bug » feature

I'm afraid it's designed that way, the idea was to mimic core as much as possible, including the placement of the error messages. And yes it's a bit strange when you have multiple forms on the same page.

I turning this into a features request, changing title accordingly.

attiks’s picture

Assigned: Unassigned » jelle_s
jelle_s’s picture

Status: Active » Needs work

Added in 6.x-1.x-dev, will port to 7.x

jelle_s’s picture

Status: Needs work » Fixed

Added in both 6.x-1.x-dev and 7.x-1.x-dev. There's also an option to define a custom function for error placement.

attiks’s picture

Assigned: jelle_s » Unassigned

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.