Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Merge requests
  • !24904

Only validate required form controls

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Mark Otto requested to merge validation-required into v4-dev Nov 28, 2017
  • Overview 0
  • Commits 2
  • Pipelines 0
  • Changes 2

This changes the form validation styles to only apply to elements with an explicit required attribute. While working on a new form example for #24898, it caught me off guard that we were saying optional inputs were valid when in fact there's nothing to actually validate. This change ensures that only required inputs, selects, textareas, and custom form controls are validated and effectively treats all non-required form controls as opt-in for form validation styles.

Here's the before and after to show you what I mean. Note how the second address line and two checkboxes shouldn't be green as it implies we performed validation on values that don't exist.

Before After
screen shot 2017-11-28 at 2 04 25 pm screen shot 2017-11-28 at 2 05 01 pm
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: validation-required