Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Validating form fields with regular expression

Avatar

Avatar
Validate 1
Level 2
alexandrad27705
Level 2

Likes

2 likes

Total Posts

19 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 2
alexandrad27705
Level 2

Likes

2 likes

Total Posts

19 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
alexandrad27705
Level 2

16-03-2016

Hi, 

I am creating an adaptive form in AEM based on an XDP file. I am having the general problem of understanding the format the validation patterns need to be in. Adobe Designer, where I create the XDP files, seems to have it's own pattern format -

E.G. "text{'('999')' 999-9999}" for validating a US phone number and 'text{OOOOOOOO'@example.com'}" to validate an email (this does not even work)

Unfortunately, all the built-in examples, as well as the examples in the documentation are based on a set number of characters. I would like to correctly validate all fields (email etc) and also text fields which can have an unlimited number of characters but only have a-z/A-Z characters. I am not able to define that correctly in Designer and also not in AEM on the form field field itself. It says "Regular Expression are permitted." but this seems to be incorrect.

Can someone shed some light on the general validation that is being done in that weird format? 

Any help would be greatly appreciated. 

Thanks. Alex

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 5
Employee
mandeepg6805152
Employee

Likes

7 likes

Total Posts

47 posts

Correct Reply

28 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Affirm 5
Affirm 3
View profile

Avatar
Boost 5
Employee
mandeepg6805152
Employee

Likes

7 likes

Total Posts

47 posts

Correct Reply

28 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Affirm 5
Affirm 3
View profile
mandeepg6805152
Employee

25-03-2016

'text{OOOOOOOO'@example.com'} 

The above would work if and only if you write an 8 character string and nothing else. This special regex (its not exactly regex) is part of XFA spec and you can study about googling XFA spec.  

I can suggest a simple way that is to write a validation expression that returns true or false if you want validations for the field. 

Answers (0)