Skip to main content
lakshmir18362498
Participant
Mar 3, 2019 7:59 AM UTC
Answered

restricting form field to numbers without separators on XI

restricting form field to numbers without separators XI

This topic is closed to new replies. Start a new post to keep the conversation going.
try67
try67Correct answer
Community Expert
Mar 3, 2019 9:38 AM UTC

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

9 replies

JR Boulay
Community Expert
Community Expert
Mar 3, 2019 8:29 AM UTC

Hi

Translate
Acrobate du PDF, InDesigner et Photoshopographe
try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
Mar 3, 2019 9:38 AM UTC

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

Translate
lakshmir18362498
Participant
Mar 4, 2019 3:29 AM UTC

Translate