Skip to content

FEATURE: Add value validation regex #13

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

Merged
merged 2 commits into from
Jun 6, 2024
Merged

Conversation

janzenisaac
Copy link
Contributor

@janzenisaac janzenisaac commented Jun 6, 2024

Relies upon: discourse/discourse#27369

Custom User Fields do not have any type of validation provided by core, outside of detecting an empty value on a required field. This PR adds the ability to define a regex, per custom user field, that will then be checked against the provided input value.

Preview

Admin

Create a user custom field and add a value validation regex

Screenshot 2024-06-05 at 11 18 20 PM

The user custom field's value on the signup form will now be tested against the regex you have included.

No value (relies on default form validation)

Screenshot 2024-06-05 at 11 07 04 PM

Incorrect value

Screenshot 2024-06-05 at 11 07 40 PM

Correct value

Screenshot 2024-06-05 at 11 08 02 PM

@janzenisaac janzenisaac marked this pull request as ready for review June 6, 2024 18:50
@janzenisaac janzenisaac force-pushed the add-value-validation-regex branch from 08bef44 to f6bce5f Compare June 6, 2024 18:53
@janzenisaac janzenisaac merged commit 3187cf0 into main Jun 6, 2024
@janzenisaac janzenisaac deleted the add-value-validation-regex branch June 6, 2024 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants