سؤال

I have a form in arabic language it uses cleditor for textarea's. How to make the text direction of cleditor from right to left and the cursor must point to the end of text when typed.javascript code tried is as follows:

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

Can anyone help!!!!

هل كانت مفيدة؟

المحلول

You would just have to do the below in-order to change the text direction in CLEditor.

$("#test").cleditor({
                      bodyStyle: "direction:rtl"
                    });

Check this fiddle for a demo.

نصائح أخرى

You can use tinyMCE Editor

Refer : http://www.tinymce.com/enterprise/using.php

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top