#skip_validation_errors : complement of #limit_validation_errors

Created on 14 October 2010, over 14 years ago
Updated 21 June 2023, about 2 years ago

Probably too late for D7, but filing as a feature request for D8.

D7 introduced #limit_validation_errors so that AJAX/multistep interactions are not cluttered with validation errors on parts of the form not involved in the step. The property points a subpart of the $form array, for which validation is performed - validation is skipped for the rest of the form.
In a followup, #763376: Not validated form values appear in $form_state pushed the effect much further : if #limit_validation_errors is used, then only the elements in the $form subpart show up in $form_state['values'].

This API is fine for the primary use case this was introduced for : "add more" buttons, which shouldn't be blocked on "node title is required".

A different pattern, found on Field UI's "Manage display" is : display a subform (formatter settings), with 'Submit' and 'Cancel' buttons relevant to that subform - the 'Cancel' button should skip validation within the subform.
Using #limit_validation_errors is tricky here, because it would require we explicitly specify 'the rest of the form' (without the subform) - really difficult, and completely unfriendly for modules altering the form. The fact that form element not mentioned in #limit_validation_errors are hidden from $form_state['values'] makes it even worse.

What we need here is an alternate #skip_validation_errors option, that has a reversed semantics : lets you specify a part of the form where validation errors are skipped - i.e the complement of what you'd put in #limit_validation_errors.

Feature request
Status

Postponed: needs info

Version

9.5

Component
Form 

Last updated about 13 hours ago

Created by

🇫🇷France yched

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States smustgrave

    Wonder if this is still needed for D10 with so little movement?

  • Status changed to Closed: works as designed 2 months ago
  • 🇳🇿New Zealand quietone

    Nearly another two years and there is no discussion or support for this idea.

    The proposal doesn't met the Criteria for evaluating proposed changes . In this case, there is not demonstrated demand and support for the change.

    If there is interest in this re-open the issue and add a comment. Or open a new issue and reference this one.

Production build 0.71.5 2024