N°7698 - Fix plain text value in HTML field being seen empty

This commit is contained in:
Stephen Abello
2024-07-24 12:01:19 +02:00
parent 841a2474af
commit 4360ad6502

View File

@@ -324,11 +324,11 @@ function ValidateCKEditField(sFieldId, sPattern, bMandatory, sFormId, nullValue,
return;
}
let sTextContent;
// Get the contents without the tags
let sFormattedContent = oCKEditor.getData();
// Get the contents without the tags
sTextContent = $(sFormattedContent).text();
// Get the contents without the tags
// Check if we have a formatted content that is HTML, otherwise we just have plain text, and we can use it directly
sTextContent = $(sFormattedContent).length > 0 ? $(sFormattedContent).text() : sFormattedContent;
if (sTextContent === '') {
// No plain text, maybe there is just an image