Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Form Validation #958

Open
adeelhussain opened this issue Jan 28, 2025 · 0 comments
Open

Custom Form Validation #958

adeelhussain opened this issue Jan 28, 2025 · 0 comments

Comments

@adeelhussain
Copy link

Current Behavior

Right now we don't have any way of validating form, e.g i want to send data to my CRM which have some requirements for specific fields.
Lets say we want to select email field to specific input but if have select invalid value, like date for the email input, then when the data is being sent my record will be break.

Desired Behavior / Feature Request

While mapping input fields with the data, we should be able to add custom validations for specific input.

like this

operation: { inputFields: [ { key: 'email', label: 'Email Address', type: 'string', required: true, helpText: 'Please enter a valid email address.', // Using a regular expression for validation validation: { regex: '^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$', errorMessage: 'Must be a valid email address.' } }, { key: 'zip_code', label: 'ZIP Code', type: 'string', required: true, helpText: 'Enter a 5-digit ZIP Code.', validation: { regex: '^\\d{5}$', errorMessage: 'ZIP Code must be exactly 5 digits.' } } ] }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant