Question

I have a form in Arabic language in which I am using CLEditor for text area.Editor works fine but earlier I have used a JavaScript function to change the text direction of textarea from right to left as the form was in Arabic. The JavaScript function used is

function rtl(element)
        {   
            if(element.setSelectionRange){
                element.setSelectionRange(0,0);
            }
        }
 <textarea name="test" id="test"   onkeyup="rtl(this);"></textarea>

How to make the JavaScript function work on cleditor? Is it possible?

Was it helpful?

Solution

I think you would just need to add the following to change the text direction in cleditor.

$("#test").cleditor({
                      bodyStyle: "direction:rtl"
                    });
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top