Auth0 Home Blog Docs

Add a validation rule to custom checkbox field in Lock 10

lock-10
customize
checkbox

#1

Is it possible to add a validation rule to custom checkbox field (type checkbox) in Lock 10? More precisely I would like to know if the user checked this box to indicate his agreement to our terms and conditions. Now it looks like that this validation rule is ignored.


Add a validation rule to custom checkbox field in Lock 11
#2

By looking and experimenting with the code the conclusion seems to be that such a possibility is not currently supported and the validator function as mentioned in the documentation is available only for text inputs. For database connection users you could consider just having the validation in a pre-registration hook, however, even though this would block the registration process the user experience is not equivalent.


#3

Finally found it: for Sign Up Agreement this feature is already implemented in Lock 10:
https://auth0.com/docs/libraries/lock/v10/new-features#sign-up-terms-agreement


#4

Damn, my bad; I focused on the specific issue in the title and totally missed the subject of the checkbox was terms and conditions. Having said that, have in mind that at this time that feature is just client-side and specific to Lock (the signup endpoint would still allow signups that could technically be performed without going through Lock and that checkbox).


#5