Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
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.

View solution in original post

5 Replies

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?

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.