Hi
I'd like to do the validation while saving content via inline editing. Could you please share if it'd be possible to do so and how?
I'm using AEM 6.2
Thanks,
Vijay
Solved! Go to Solution.
Views
Replies
Total Likes
What kind of validation are you referring to? Is this for the richText editor, inline-editing? Please be more detailed in your requirements and goals.
Views
Replies
Total Likes
What kind of validation are you referring to? Is this for the richText editor, inline-editing? Please be more detailed in your requirements and goals.
Views
Replies
Total Likes
Views
Replies
Total Likes
Hmm, it might easier for your development implementation if you only allow this rich-Text field to only be edited in the Touch UI editor. Once the user saves the dialogue changes, either an alert or an error message will be shown to the user, and not allowing the dialogue to be saved.
You can achieve this with the Granite UI Validation API.
A short and sweet example can be found here, where it examples how the multifield is validated when attempted to be saved.
https://blogs.perficient.com/2018/10/26/simple-multifield-max-item-validation-for-aem-6-4/
$(window).adaptTo("foundation-registry").register("foundation.validation.validator", {
selector: "[data-foundation-validation^='validate-url']",
validate: function(el) {
// validate will be invoked, every time when the dialogue is being saved.
// validate logic uses JQUERY to get dialogue values from the Granite UI.
// return false to dis-allow saving.
// return true to allows saving.
return isValidationCorrect($(el).text());
}
});
function isValidationCorrect(text) {
...
}
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies