Add Validation to Content Fragment Multifield | Community
Skip to main content
Level 3
Jun 15, 2022 5:17 PM UTC
Solved

Add Validation to Content Fragment Multifield

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 ??

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
SantoshSai
SantoshSaiAccepted solution
New Participant
Jun 16, 2022 6:31 PM UTC

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

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 

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

5 replies

Level 3
Jun 15, 2022 5:41 PM UTC

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.

Translate
SantoshSai
New Participant
Jun 15, 2022 6:36 PM UTC

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

Translate
Santosh Sai