Skip to main content
Legacy User
March 10, 2023
Solved

I need to validate a field to be 9 digits (numbers only with no spaces). What's the regex I need to use?

  • March 10, 2023
  • 5 replies
  • 995 views

 The field is used to store a code - its not a number ie uses a separator.  So I can't set it to field type Number

Best answer by Community Expert

Hello,

Does this one work^[0-9]+$ ? the system should not allow the recipient to complete the envelope if there is a space or letter in the text field.

Let us know if you need further assistance with this.

Best regards,

Christopher | DocuSign Community Moderator

"Select as Best" below if you find the answer a valid solution to your issue.

5 replies

Legacy User
March 10, 2023

Hello,

Thank you for reaching out here in the DocuSign Community.

Does this /^\\d+$/ pattern works or this one /^[0-9]{0,}$/ ?

Let us know if you need further assistance with this.

Best regards,

Christopher | DocuSign Community Moderator

"Select as Best" below if you find the answer a valid solution to your issue.

Legacy User
March 13, 2023

Thanks @Christopher Alpizar​ - I tried both and tested on the Preview. Neither worked. Everything I entered wasn't accepted.

eg 123456789 (which should be valid as 9 digits, all numbers with no spaces) but it wouldn't proceed

Docusign Employee
March 14, 2023

Hello,

Does this one work^[0-9]+$ ? the system should not allow the recipient to complete the envelope if there is a space or letter in the text field.

Let us know if you need further assistance with this.

Best regards,

Christopher | DocuSign Community Moderator

"Select as Best" below if you find the answer a valid solution to your issue.

Legacy User
March 15, 2023

Yes - thanks that one's has done the job. (Maybe it was the / at the end of the other two patterns which caused them not to work)

Freddie A
Conversation Starter
Conversation Starter
July 26, 2024

I see this works for 4 Numbers but what If I need them random, this is in order only. 

Freddie Amerson