Team,
We required users can enter only 10 digits in mobile Number column. Pl guide how can achieve this.
Team,
We required users can enter only 10 digits in mobile Number column. Pl guide how can achieve this.
Hi Kundan,
To restrict a phone number field to 10 digits only, you can use Validations.
After dropping the Phone control, you can go to the validations tab and apply the validation.
This is how the validations will look.
The First check adds minimum number to be 999999999 which is 9 digits long
The Second check adds the maximum number to be 9999999999 which is 10 digits long.
We will try to add length validation in the phone number field soon , but till then this should work.
Regards,
Mohit
Hi Mohit,
Thanks for your guidance how to achieve validation, Although I think we have to modify some parameters to fully achieve this.
Hi Kundan,
The correct solution would be to use regular expression.
You can use the regex ^[6-9]\d{9}$
as shown above.
This will validate:
Further Reading:
For Indian pin code validation, You can use regex too.
It would look something like
This will validate:
Hope this helps.
Regards,
Mohit.
Appreciable Efforts. Great, Thank you for help.
HI Kundan,
We are doing a small fix on Phone control due to which you might face issues while applying regular expressions to it. This will be fixed very soon.
I would recommend you continue creating the app and we’ll let you know once you can use regular expression in this control.
If you need to use the field right now, you can use a text control where this regular expression will work.
Regards,
Mohit.
Hi Kundan,
You can now use the regular expression for the said use case.
Regards,
Mohit Agarwal.
Dear Mohit,
On the Same FOrmat to Validate PAN Number, I am using regex ^[A-Z]{5}[0-9]{4}[A-Z]{1}$ and ^[A-Z]{5}[0-9]{4}[A-Z]$
But the same is not working, please guide or give me any tutorial to use regex function.
Hi Kundan,
To make PAN card work, you can use the Regex:
^[a-zA-Z]{5}[0-9]{4}[a-zA-Z]{1}$
Here we check for lower and uppercase letters both, this ensures more cover and works fine.
Regards,
Mohit.