Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events
SOLVED

Luhn's Algorithm for Form Validation

Avatar

Level 1

Has anybody figure out how to use the Luhn's Algorithm for the Form Component? If you add a form element, like TextField, you can select a validation as part of the Constraint tab. In that tab, there is an option for Luhn's algorithm to validate credit cards and some government IDs. 

However, whenever the drop down field for the constraint is selected, nothing else happens.

I looked at the documentation but there is no reference to this feature.

Any comment/suggestion is welcomed.

Mario

1 Accepted Solution

Avatar

Correct answer by
Level 10

Why don't you develop your own form component and then add this logic  to it. You can use other JavaScript frameworks too. For example - with AEM -- you can use JQuery APIs and various plugins to work with credit card validation. For example:

http://jquerycreditcardvalidator.com/

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

Why don't you develop your own form component and then add this logic  to it. You can use other JavaScript frameworks too. For example - with AEM -- you can use JQuery APIs and various plugins to work with credit card validation. For example:

http://jquerycreditcardvalidator.com/