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
  • !34043

Make a form validation handler | handle form messages

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open GeoSot requested to merge gs-forms into main May 20, 2021
  • Overview 21
  • Commits 3
  • Pipelines 0
  • Changes 11

A Javascript handler for form|fields messages.

As a developer, I have been several times, in the awkward position, needing to implement custom code, that will co-operate with bs-form fields. So, many times I had the same thought. "What if bootstrap provided the base 'JS adapter' for its fields"

This PR tries to provide a Bootstrap component, that automatically handle browser validation messages, and in addition will give the opportunity to use custom, given feedback messages.

In advance, it contains JavaScript code, providing

  • on form component:
    • method to clear these messages,
    • get FormData` (for ajax usage)
    • execute validation
    • access each formField instance
    • JS hook, through component configuration, where developers can use for Ajax submission (not provided by default) and/or attach any custom validation messages
  • per field methods:
    • clear appended feedbacks
    • append success | error | info feedback messages

Needs:

  • Documentation
  • Tests
  • Feedback

Cons: Adds a significant size as it introduces two new classes 🤔

Related #28414 close #28995

Preview : https://deploy-preview-34043--twbs-bootstrap.netlify.app/docs/5.2/forms/validation/#custom-styles

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: gs-forms