restricting form field to numbers without separators on XI

New Here ,
Mar 02, 2019 Mar 02, 2019

Copy link to clipboard

Copied

restricting form field to numbers without separators XI

TOPICS
PDF forms

Views

587

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Mar 03, 2019 Mar 03, 2019

Technically, that still allows the user to enter the minus symbol and a period.

If you really want to only allow numbers you can use this code as the custom Keystroke script:

event.rc = /^\d*$/.test(event.change);

Likes

Translate

Translate
Community Expert ,
Mar 03, 2019 Mar 03, 2019

Copy link to clipboard

Copied

Hi

Capture.png

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 03, 2019 Mar 03, 2019

Copy link to clipboard

Copied

Technically, that still allows the user to enter the minus symbol and a period.

If you really want to only allow numbers you can use this code as the custom Keystroke script:

event.rc = /^\d*$/.test(event.change);

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 03, 2019 Mar 03, 2019

Copy link to clipboard

Copied

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 04, 2019 Mar 04, 2019

Copy link to clipboard

Copied

Correct.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 11, 2022 Aug 11, 2022

Copy link to clipboard

Copied

Hi Gilad,

I found this really useful, thanks for the post.

I've tried to amend the reg exp to allow a '+' symbol, for a telephone number area code, and spaces but as yet no luck. Please can you point me in the right direciton.

Thanks in advance.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 11, 2022 Aug 11, 2022

Copy link to clipboard

Copied

LATEST

In that case I recommend using the Arbitrary Mask under Format - Special. You can specify this pattern like this (for example):

+99 999 9999

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines