Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

Numeric field validation

Avatar

Level 3

I have a numeric field that has a combination of 8 numbers/characters

It must be posible that the first number is a zero.

So i'm using the following pattern num{99999999}

This works fine, but when they enter only 2 numbers the field fils with zero's

How can i change this?

And how to do a validation on keystroke or exit that gives an error when the enter a non numeric character?

I entered 99999 on the validation pattern en entered an error message, but it doesn't work

1 Accepted Solution

Avatar

Correct answer by
Level 10
5 Replies

Avatar

Level 10

Hi,

If you use a numericField instead of a textField, you don't have to worry about characters being inputted.

With the numeric field you can comb it to 8 digits and the display pattern of num{99999999} will work. You don't need any validation script then.

Good luck,

Niall

Avatar

Level 3

Yes, that's true

But my customer wants a warning when the enter an invalid character

So how can i do this?

Avatar

Correct answer by
Level 10

Avatar

Level 3

Thank you,

Searching a forum in an other language then my own is sometimes hard.

Avatar

Level 10

No problem

I had updated the example and it is available here: https://acrobat.com/#d=rW9e9l1aKsCpG1jcQLPs5w

Good luck,

Niall

Assure Dynamics