AEM Forms DOB or SSN auto append / or - when user enters the value in the form fields



Hi Team,

How to append / or - when user enters the value in aem form fields. For DOB it should append / like 12/12/1990 and for SSN it should append - like 122-321-1234. Patterns option is validating once the focus is out from the form fields whether the value is with that particular format or not.

Is it possible to add / or - while entering the form field value using guideBridge API. If so can you please share some insights or examples. Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)




You might have to intercept the field on key press event and add the pattern as required after checking the input length.



// Your code



Replace guideContainer-rootPanel-basics-basics1-guidetextbox_15663786___widget with your element ID, you can obtain it from browser debugger. This need to be placed in code editor on initialize event.


javascript events - jQuery get input value after keypress - Stack Overflow

Answers (0)