Add Validation to Content Fragment Multifield | Community
Skip to main content
Level 3
June 15, 2022
Solved

Add Validation to Content Fragment Multifield

  • June 15, 2022
  • 1 reply
  • 1324 views

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.
Best answer by SantoshSai

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.

1 reply

Level 3
June 15, 2022

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.

SantoshSai
Community Advisor
Community Advisor
June 15, 2022

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

Santosh Sai