top of page

Wix Forms - how to validate a 9-digit number

I had a Wix Forms Question for a client, we wanted to validate that a form field has 9 numeral digits (for an account number) before submitting. She also had another field that she wanted just 5 digits allowed.

I tried some pattern validation codes (like "^\d{9}$ " and the one shown above), but none of them worked. I scheduled a call and talked with Wix Phone Support and they said it wasn't possible. But they were wrong, it is possible!

I figured out a hack workaround. You can choose Phone Number from the Type under your Text Input Settings for the field, and then choose Select Number Format and choose Custom, then put in the format desired. In this case my client wanted it in this format: ###-##-####, but you could do ####-#### or #-###### or whatever you want! Just because you choose Phone Number for the type, that doesn't mean it has to be a standard phone number format, and, you can name it anything you want in the field name/title for the backend submissions. This works perfectly. You can do this with any number, too, if you want to make sure it's a certain number of digits.

Happy Wixing!


Recent Posts

See All

Reach out with questions or for a free design estimate:

As a website designer and graphic designer, I love sharing great tips and tools that make designing easier. As part of my website design services, I train clients on how to update their websites or to do their own SEO (search engine optimization), so I post many of these tips for my clients to train them how to use Wix and other tools to keep their website up-to-date. Keeping websites current is the best way to get found and to keep people coming back to your website. 

Check out all my Design & SEO tips and resources in my blog

bottom of page