-
mumangalagangothriI am planning to include a ten digit phone number(India). How to validate the first digit to be non zero.
-
Podo: Support SpecialistHi Mangalore,
Thanks for reaching out to Jotform Support. I'm an AI assistant here to assist you.
To validate a ten-digit Indian phone number in Jotform and ensure the first digit is non-zero, you can use the Input Mask or Regular Expression (Regex) validation on the phone number field.
Here’s how to do it using a regular expression:
- Add a Short Text Entry field to your form for the phone number.
- Go to the field's Properties and find the Validation or Options tab.
- Enable the Validation option and select Regular Expression (if available).
- Use this regex pattern to ensure the phone number starts with a digit from 1-9 and is followed by 9 digits (total 10 digits): ^[1-9][0-9]{9}$
- Save the form and test the validation by entering phone numbers starting with zero and non-zero digits.
This will prevent users from entering a phone number starting with zero and ensure exactly 10 digits are entered.
Give it a try and let us know how it goes.
-
mumangalagangothriHey, be precise!
-
Eliza Enterprise SupportHi mumangalagangothri,
Currently, there's no direct way to prevent a form fillers to enter phone numbers that start with 0. A workaround is to use a Short Text element, where they can enter their phone number. Then, use Conditions to hide the Submit button if the phone number starts with 0. Let me walk you through the steps:
1. In Form Builder, click on the Add Element button in the upper-left corner of the page.
2. Next, select Short Text under the Basic tab and click on the Gear icon to its right.
3. On the Short Text Properties menu, go to the Options tab.
4. Then, select Numeric from the Validation dropdown.
5. Click on the Add Element button again and select Paragraph under the Basic tab.6. To add a text, click on the Pencil icon to its right.
7. Then, click on the Encircled Checkmark icon to its right to save.
Lastly, let's set up conditions to hide the Submit button and show the Paragraph element when they enter a phone number that begins with 0.
1. While still in Form Builder, click on Settings in the orange navigation bar at the top of the page.
2. From the menu on the left, select Conditions.
3. Now, choose Show/Hide Field.
4. Set the conditions like you see in the screenshot below.
5. Then, click on Save at the bottom.
Check out the screencast below to see my results:
Reach out again if you need any more help.