BrainGrid Controller
Window creation
Field Validation

Adding Validations to Fields

User adds required validation to a field

When a user is on the window creation canvas and wants to make a field mandatory, they can add a required validation.

Info:

  • Field: Email
  • Action: Add required validation
  • Outcome: The "Email" field will be marked as required. During window submission, if the field is left empty, a message "This field is required" will be displayed to the user.

User adds disabled validation to a field

A user can make a field non-editable by adding a disabled validation.

Info:

  • Field: Username
  • Action: Add disabled validation
  • Outcome: The "Username" field will appear grayed out and will not be editable by the user.

User adds min and max validations to a field

Min and max validations restrict the range of acceptable values for a field.

Info:

  • Field: Age
  • Actions: Set minimum value to 18 and Set maximum value to 65
  • Outcome: The "Age" field will only accept values between 18 and 65. If a user enters a value outside this range, a message "Value must be between 18 and 65" will be shown.

User adds custom validation to fields

Custom validations allow users to define specific rules for fields.

Info:

  • Fields: Net Salary and Gross Salary
  • Action: Add custom validation to ensure "Net Salary" is always less than "Gross Salary"
  • Outcome: If the validation rule is violated, a message "Net Salary must be less than Gross Salary" will be displayed.

User previews the window with added validations

Users can preview the window to ensure that all added validations are correctly applied.

Info:

  • Action: Preview the window
  • Outcome: All fields will display with their respective validation rules applied, allowing users to verify the validations before saving the window.

User saves the window with added validations

After adding validations to fields, the user can save the window to apply and retain these rules.

Info:

  • Action: Save the window
  • Outcome: The window will be saved with all the updated validation rules, ensuring that these rules are enforced when the window is used.