Expand my Community achievements bar.

Adobe Summit 2025: AEM Session Recordings Are Live! Missed a session or want to revisit your favorites? Watch the latest recordings now.

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

SOLVED

Add Validation to Content Fragment Multifield

Avatar

Level 4

We have a requirement where we need to add validation on the input number in multifield in the content fragment modal. I am aware of adding granite:data node and target it while closing the dialog. But here the granite:data node is getting deleted incase the modal is updated. Is there any way i can add validation in content fragment authoring dialog ??

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@ashish_mishra1 

IMHO, It is best idea to get that input ID as an input and pass it to Servlet through ajax call and validate it. The servlet which will be responsible for handing the request and validate it.


Santosh Sai

AEM BlogsLinkedIn


View solution in original post

5 Replies

Avatar

Community Advisor

Avatar

Level 4

Thanks for the quick reply, I Have gone through these articles before asking the question.

My question is how a particular field of modal can be targetted ?

These articles talk about how the validation can be added at the global level.

Avatar

Community Advisor

@ashish_mishra1 Could you please provide dialog structure and or screenshot of multifield if possible?


Santosh Sai

AEM BlogsLinkedIn


Avatar

Level 4

This is my fragment modal, with optionId as multifield text input.

ashish_mishra1_0-1655318717633.png

Now, while creating a fragment with this modal, I want to add validation to this input. For the Ids which the author will add, I have to validate whether they are correct or not by calling a third-party system, and if correct only then allow them to create a fragment.

ashish_mishra1_1-1655318828606.png

 

 

Avatar

Correct answer by
Community Advisor

@ashish_mishra1 

IMHO, It is best idea to get that input ID as an input and pass it to Servlet through ajax call and validate it. The servlet which will be responsible for handing the request and validate it.


Santosh Sai

AEM BlogsLinkedIn