How to Count the Character of the Rich Text item in Oracle Apex

Count the Character of the Rich Text item

Count the Character of the Rich Text item

Count The Character Of The Rich Text Item In Oracle Apex Application, You Don't Need To Write Complex Code. You Can Count Characters Using The Length Property. See Sample Codes Below. In It, We Use Rich Text Item Label Shows The Number Of Characters Entered In The Rich Text Item.

How To Count The Character Of The Rich Text Item || Oracle Apex Application

How To Count Characters And Words In A Rich Text Editor Item In The Oracle Apex Application. I Hope Everyone Will Like It. Please Watch The Full Video, Comment On Any Of Your Problems, I Will Try My Best To Solve The Problem Inshallah. Everyone's Cooperation Is Desirable.

1. Add This Code On JavaScript Initialization Code Of Your Item.


function(options) {
    options.executeOnInitialization = function(editor) {
        const plugin = editor.plugins.get('WordCount');
        editor.sourceElement.parentElement.parentElement.appendChild(plugin.wordCountContainer);
    };
    return options;
}
2. Execute When Page Loads—Just For The Old Rich Text Editor-


  var lEditor1 = CKEDITOR.instances.P27_RICH_TEXT_EDITOR;
lEditor1.on("contentDom", function() {
    lEditor1.document.on("keyup", function(event) {

        var lLen = lEditor1.getData().replace(//g, "").replace(/\s+/g, " ").replace(/\w+;/g, "X").replace(/^\s*/g, "").replace(/\s*$/g, "").length;
        
        var lKey = event.data.getKey();
        if (lKey >= 48 || lKey == 8 || lKey == 32 || lKey == 46) {
            $x("P27_COUNT").value = lLen;
        }
    });
});

Post a Comment

Hlo Sir

Previous Post Next Post