Sunbird-RC / community

Repo to enable discussions, issue tracking & documentation for the Sunbird-RC projects
MIT License
12 stars 23 forks source link

Enable Pattern option #704

Open Pratikshakhandagale opened 1 year ago

suvarnakale commented 1 year ago

Enabling Custom Validation for Patterns in Formio Builder

Description: This feature aims to enhance Formio Builder by enabling users to apply custom validation patterns to specific form fields, such as mobile numbers, email addresses, or any other required formats. The pattern option will be rendered in the Formio Builder UI, allowing users to define and enforce their desired validation rules easily.

Implementation Steps:

  1. Enable the pattern option toggle switch within the Formio Builder UI for each applicable form field.
  2. Capture the custom validation pattern entered by the user when the pattern option is enabled and store the user-defined pattern within configuration of the corresponding form field.
  3. Extend the JSON schema logic to include the pattern information by adding a new property in the JSON schema to hold the pattern information for applicable form fields.
  4. Display appropriate error messages to users if validation fails, indicating the specific pattern requirement for each field.

Image

Image