Input Field and Validation in Forms
Hello,
I am trying to make Mobile Number validation, I simply want to change the pattern attribute for a regular expression for the input field of type tel in my form.
- I can't figure out where to change the "pattern" attribute for this specific form field (no attribute value options on the form fields). Is there any workaround here?
- Also is there any possibility to show a validation error message?
Thanks
-
Hi Eman,
- Unfortunately, isn't possible and we don't recommend to change the pattern attribute for a specific field form.
- If the user inserted some wrong characters in the form fields or didn't complete a form field, he will send the message, the wrong field will be highlighted with a red border and the user will need to correct the information.
Best regards,
Sandra
0 -
Hi Sandra,
Thanks for your reply.
- But what if I want to validate the phone number format to make sure it's a valid number to contact the applicant on? Is there a way to do that other than the pattern attribute? Can I have a custom js code to validate?
- Yes, I see the red border, but from a usability point of view, I wanted to indicate to the user what the error is and how to fix it.
1 -
Hi Eman,
- In the Brizy form, you can find the Telephone field type https://jumpshare.com/v/FLQK4T8YBeLA0VAIMkA6. It will help you to check if the user writes correctly the phone number;
- I'm sorry, but the Brizy form doesn't indicate what is the error and how to fix it, but I created a feature request for this option.
Best regards,
Sandra
1
Please sign in to leave a comment.
Comments
3 comments