How to cusomize validations on submit action in Adaptive Form

Avatar

Avatar
Validate 1
Level 2
Balu_M
Level 2

Likes

5 likes

Total Posts

36 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 2
Balu_M
Level 2

Likes

5 likes

Total Posts

36 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile
Balu_M
Level 2

29-11-2016

Hi , 

i have a requirement customize default error validation on Adaptive Form filed.

Problem: We have written custom validation method for email filed with onblur() event, but if user click on Submit method then my form is submitting with out calling my custom function.

I want to enable this call when user click on submit button, so that i can verify user data.

Can anyone guide me how to achieve this.

Accepted Solutions (0)

Answers (4)

Answers (4)

Avatar

Avatar
Boost 1
Level 2
gauravahuja11
Level 2

Like

1 like

Total Posts

9 posts

Correct reply

4 solutions
Top badges earned
Boost 1
Affirm 3
Affirm 1
View profile

Avatar
Boost 1
Level 2
gauravahuja11
Level 2

Like

1 like

Total Posts

9 posts

Correct reply

4 solutions
Top badges earned
Boost 1
Affirm 3
Affirm 1
View profile
gauravahuja11
Level 2

07-12-2016

Hi,

By using the rule editor, the validation script can be added for individual components as well. You can open the rule editor for the component on which you want to apply the script, or you can also select the required component from the form model tree available in the rule editor. When the submit button is clicked, it runs the validations on every component. If you've written a custom validation script, then that script will also get called.

Avatar

Avatar
Validate 1
Level 2
sixteenlabsinc
Level 2

Likes

7 likes

Total Posts

32 posts

Correct reply

9 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Affirm 5
View profile

Avatar
Validate 1
Level 2
sixteenlabsinc
Level 2

Likes

7 likes

Total Posts

32 posts

Correct reply

9 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Affirm 5
View profile
sixteenlabsinc
Level 2

29-11-2016

If you'd like to create a library of JavaScript files (and CSS) that apply to your forms then Client Libraries are the best approach. It's likely one of the most powerful features that you inherit when upgrading to AEM Forms from LiveCycle.

https://docs.adobe.com/docs/en/aem/6-2/develop/the-basics/clientlibs.html

Client Libs can be added to any number of forms and allow you to create standard libraries of features and functionality across your forms. Things like email, web, phone number validations can be added using the rule editor to make a call to your standard functions. 

Avatar

Avatar
Validate 1
Level 2
Balu_M
Level 2

Likes

5 likes

Total Posts

36 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 2
Balu_M
Level 2

Likes

5 likes

Total Posts

36 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile
Balu_M
Level 2

29-11-2016

Hi Varundua,

If i opt for rule editor its form Level and i can not re-use the validation, I would like to apply validations at component level. So that author can configure it.

Is there possibility for component level validations?

Avatar

Avatar
Boost 3
Level 2
varundua
Level 2

Likes

4 likes

Total Posts

32 posts

Correct reply

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

Avatar
Boost 3
Level 2
varundua
Level 2

Likes

4 likes

Total Posts

32 posts

Correct reply

10 solutions
Top badges earned
Boost 3
Boost 1
Affirm 5
Affirm 3
Affirm 10
View profile
varundua
Level 2

29-11-2016

Hi
 

You can write the validation script on the validation event. If you are on 6.2 or 6.1 FP1 you can use the Rule Editor to add your validation logic using the Visual Editor

For more advance use case you can specify that using code editor where you can write any custom JavaScript 

For more information on rule editor please visit [1]

[1] https://helpx.adobe.com/aem-forms/6-1/rule-editor.html