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

How do I allow users to enter numbers and commas ONLY on input box

New Here ,
Sep 24, 2018 Sep 24, 2018

Hi all,

What I am trying to do is, I have a form that I ask users to input department numbers separated by commas, but people are still entering department descriptions. I want to force them to only be able to enter numbers and commas, but no other characters. Something I could use in the Custom Keystroke Script box.

Any help would be greatly appreciated.

Thank you

TOPICS
PDF forms
769
Translate
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
1 ACCEPTED SOLUTION
Community Expert ,
Sep 24, 2018 Sep 24, 2018

Go to the field's Properties, Format, select Custom, and enter the following as the custom Keystroke script:

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

View solution in original post

Translate
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 ,
Sep 24, 2018 Sep 24, 2018

Go to the field's Properties, Format, select Custom, and enter the following as the custom Keystroke script:

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

Translate
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 ,
Sep 24, 2018 Sep 24, 2018

Thank you so much try67. Your help is very much appreciated.

Regards

Chico..

Translate
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 ,
Jan 22, 2025 Jan 22, 2025
LATEST

I have a variation on the above question: how can I do the same thing but limit the input to 2 digits after the decimal comma?

(In French format the decimal point is a decimal comma)

try67


Acrobate du PDF, InDesigner et Photoshopographe
Translate
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