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

decimal

Participant ,
Jun 03, 2022 Jun 03, 2022

Copy link to clipboard

Copied

I am trying to find the way to prevent a text field from ever using decimals. I forgot the method?

TOPICS
Create PDFs , PDF forms

Views

517

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 , Jun 03, 2022 Jun 03, 2022

Use this code as the field's custom Keystroke script:

 

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

Votes

Translate

Translate
Community Expert ,
Jun 03, 2022 Jun 03, 2022

Copy link to clipboard

Copied

Set field format to number and select 0 decimals.

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
Participant ,
Jun 03, 2022 Jun 03, 2022

Copy link to clipboard

Copied

that does not work. I want the field to accept  WHOLE NUMBERS. no POINT NO COMMA NO LETTERS.

It might need js

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 ,
Jun 03, 2022 Jun 03, 2022

Copy link to clipboard

Copied

Use this code as the field's 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
Participant ,
Jun 04, 2022 Jun 04, 2022

Copy link to clipboard

Copied

LATEST

TRY67 has the correct answer, as usual. Thank you. 🙂

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
Participant ,
Jun 04, 2022 Jun 04, 2022

Copy link to clipboard

Copied

Sorry, you did not have the correct answer, your method still allows the comma and period.

 

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