• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

1.6K

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);

Votes

Translate

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

Copy link to clipboard

Copied

Hi

Capture.png

Votes

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);

Votes

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

Votes

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.

Votes

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
Contributor ,
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.

Votes

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

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

+99 999 9999

Votes

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 ,
Oct 12, 2022 Oct 12, 2022

Copy link to clipboard

Copied

I am a newbie in javascript, Please can you help me,  a code allows Alphabet characters only or both Alphabetic and numbers (symbols/special characters restricted) 

Votes

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 ,
Oct 12, 2022 Oct 12, 2022

Copy link to clipboard

Copied

Letters only: event.rc = /^[a-z]*$/i.test(event.change);

Letters and digits only: event.rc = /^[a-z\d]*$/i.test(event.change);

Votes

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 ,
Oct 12, 2022 Oct 12, 2022

Copy link to clipboard

Copied

LATEST

Perfect! Thank You so much 

Votes

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