Problem/Motivation

Given that we have more than one ajaxified form in the same page, when the user submits one of then for the first time with validation erros, the "error" class is applied as expected. But if the other one is also submited with no errors, then the first one keeps the error classes.

I also noticed that the "error" class from checkboxes or radio button aren't removed when I perform the same test reported above.

See the screeshot for clarification.

Proposed resolution

- Move the ajax command that removes the error class to be performed before the form error validation check.
- Add a new ajax command that removes the error class from elements that have the ".form-checkboxes" or ".form-radios" classes.

Remaining tasks

None.

User interface changes

No UI changes.

API changes

No API changes.

Comments

revagomes’s picture

StatusFileSize
new54.54 KB
revagomes’s picture

Title: Form validation issues when multiple ajaxified forms on the same page » Form validation issues when multiple ajaxified forms in the same page
revagomes’s picture

Here goes the patch!

  • eme committed 7c627c7 on 7.x-1.x
    git commit -m 'Issue #2365073 by revagomes: Form validation issues when...
eme’s picture

Status: Needs review » Fixed

Commited. You're entirely right about checkboxes and radios. About removing errors from the other forms, I'm not quite sure as we're messing a bit from one form to another. The system was developed to be independant. For now I have commited the removing everywhere but it may be more consistent to be more specific and work only on the right form...

Status: Fixed » Closed (fixed)

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