Click here to Skip to main content
15,886,664 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello,
i want to do this but i cant please help me:
i have one textarea wich works and do the true job but when i connect it to ckeditor
doesnt work.
the job that textarea should do is:
it should connect to jquery with an id and after that do the counter job and limit the text in contact us for 100 word.
it works.
but when i connect the text area to the ckeditor my counter not work.
the code is :
php :
XML
echo"<div id='ckhide'>";
echo"<form method='post'action='index.php'>";
echo"<div id='indexck'><textarea id='tck'class='ckeditor'name='editor1'></textarea></div>";
echo"<input type='text'class='sbjarea'value='موضوع پست حداکثر سی کلمه'name='sbj'maxlength='30'/>";
echo"<input type='submit'id='cksend1'value='ارسال پست'name='cksend1'/>";
echo"<div id='chare'></div>";
echo"</form>";
echo"</div>";

jquery :
C#
$('#chare').text('4000 کاراکتر مانده');
$('#tck').keyup(function(){
var a=$('#tck').val();
$('#tck').html(a);
    var max = 4000;
    var len = $(this).val().length;
    if (len > max) {
        $('#chare').text('متن شما بیش از حد مجاز است .');
        $('#cksend1').hide(0);
    }
    else if (len ==0) {
        $('#cksend1').hide(0);
        $('#chare').text('50 کاراکتر مانده');
    }
    else {
        var ch = max - len;
        $('#chare').text(ch + ' کاراکتر مانده');
        $('#cksend1').fadeIn(0);
        }
});

my problem is with :
id='tck'
when the class='ckeditor' is in the textarea its not work
but when the class='ckeditor' isnt in the textarea its work true
i want to connect to ckeditor and do this
please help me!
Posted
Updated 18-Apr-15 13:50pm
v4
Comments
ramyajaya 18-Apr-15 19:57pm    
mention your ckeditor code and check in your browser error console whether it shows any error in it

1 solution

It makes no sense at all. Ckeditor is not based on textarea. Instead, it is based on the contexteditable attribute, probably as all editors of this kind. Please see:
http://html5doctor.com/the-contenteditable-attribute[^],
https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_Editable[^],
http://www.w3.org/TR/html5/editing.html[^].

Not only you idea of textarea is wrong, it is unclear to me. I have no idea what in your understanding "connect" should mean. You don't need any "connect"; you can either just use this or any other similar editor, or write your own based on the information I referenced above.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900