Problem in Add a word counter to the editor
3 posters
Page 1 of 1
Problem in Add a word counter to the editor
the code in that page
https://help.forumotion.com/t131191-add-a-word-counter-to-the-editor#879368
is only working for English letters and dose not recognize the arabic letters can any one fix this for me
otherways the code wont work at my forum thanks
https://help.forumotion.com/t131191-add-a-word-counter-to-the-editor#879368
is only working for English letters and dose not recognize the arabic letters can any one fix this for me
otherways the code wont work at my forum thanks
Last edited by Michael_vx on March 22nd 2014, 7:54 pm; edited 1 time in total (Reason for editing : Problem solved)
Michael_vx- Forumember
-
Posts : 664
Reputation : 29
Language : Arabic and some English
Location : Egypt
Re: Problem in Add a word counter to the editor
Someone would need to translate the code into Arabic so it would recognize the Arabic letters.


Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Problem in Add a word counter to the editor
I'll have a look when I have free time. The problem may be with the regular expression.
Re: Problem in Add a word counter to the editor
thats good news to i will be waiting for the fixed code that able to count Arabic lettersAnge Tuteur wrote:I'll have a look when I have free time. The problem may be with the regular expression.
Michael_vx- Forumember
-
Posts : 664
Reputation : 29
Language : Arabic and some English
Location : Egypt
Re: Problem in Add a word counter to the editor
is there any good news about the code ?
Michael_vx- Forumember
-
Posts : 664
Reputation : 29
Language : Arabic and some English
Location : Egypt
Re: Problem in Add a word counter to the editor
I've converted it to a character counter, it is a bit difficult to count the Arabic words since they are not recognized as a word character.
Try this :
To change the minimum number of characters modify the value of MinNumberOfChars.
Try this :
- Code:
$(function(){$(function(){
var MinNumberOfChars = 50;
var ico_compl = "http://i73.servimg.com/u/f73/18/10/89/49/ok-gre10.png";
var ico_incompl = "http://i73.servimg.com/u/f73/18/10/89/49/exclam10.png";
if($("#text_editor_textarea").length != 0){
$("input[type='submit'][name='post']").attr("disabled", true).css("opacity", "0.5");
$(".sceditor-container").after("<br/><div id='div_minchars' align='center'><div id='div_minchars_header'> Minimum characters to send a message: " + MinNumberOfChars + " </div><div id='div_minchars_info'></div></div>");
var sceditor = $("#text_editor_textarea").sceditor("instance");
var str = sceditor.val();
var str_len = str.length;
if(str_len >= MinNumberOfChars) $("input[type='submit'][name='post']").attr("disabled", false).css("opacity", "1");
sceditor.keyUp(function(e) {
str = sceditor.val();
str_len = str.length;
if(str_len >= MinNumberOfChars) {
$("#div_minchars_info").html("You've written <span style='color:green'>" + str_len + "</span> character(s). You can now send the message <img src='" + ico_compl + "' />");
$("input[type='submit'][name='post']").attr("disabled", false).css("opacity", "1");
}else{
$("#div_minchars_info").html("You've written <span style='color:red'>" + str_len + "</span> character(s). You need " + (MinNumberOfChars - str_len) + " character(s) to send this message <img src='" + ico_incompl + "' />");
$("input[type='submit'][name='post']").attr("disabled", true).css("opacity", "0.5");
}
});
}
})});
To change the minimum number of characters modify the value of MinNumberOfChars.
Re: Problem in Add a word counter to the editor
thanks so much its worked
Problem solved
thanks so much again
Problem solved
thanks so much again
Michael_vx- Forumember
-
Posts : 664
Reputation : 29
Language : Arabic and some English
Location : Egypt

» Editor Word Counter
» Add a word counter to the editor
» Help with word counter?
» A word counter
» something not right i just noticed about word counter
» Add a word counter to the editor
» Help with word counter?
» A word counter
» something not right i just noticed about word counter
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum