Words problem in Javascript
5 posters
Page 1 of 1
Words problem in Javascript
Forum version : #phpBB2
Position : Founder
Concerned browser(s) : Google Chrome
Who the problem concerns : Yourself
Forum link : https://ekin-ek.666forum.com/
- - - - - - - - -
If I use this code,the navigation bar will disappear.(And,close code,it will recover.)
→In the topics:Limiting the number of words has no effect.
→In all the pages:Can limit the number of words, but the mobile navigation bar will disappear.
I don't know why.
【From https://help.forumotion.com/t121475-minimum-character-post?highlight=minimum+characters】
Position : Founder
Concerned browser(s) : Google Chrome
Who the problem concerns : Yourself
Forum link : https://ekin-ek.666forum.com/
- - - - - - - - -
If I use this code,the navigation bar will disappear.(And,close code,it will recover.)
→In the topics:Limiting the number of words has no effect.
→In all the pages:Can limit the number of words, but the mobile navigation bar will disappear.
I don't know why.
【From https://help.forumotion.com/t121475-minimum-character-post?highlight=minimum+characters】
- Code:
$(function() {
var x=document.forms['post'];
$(x.post).click(function(e) {
if (x.message.value.length < 10) {
e.preventDefault();
alert('Your post must contain at least 10 character');
}
});
});
Last edited by Winging on November 23rd 2020, 2:00 pm; edited 2 times in total
Re: Words problem in Javascript
hello
the code is old maybe you want to try this one https://help.forumotion.com/t131191-add-a-word-counter-to-the-editor?highlight=editor+limit
the code is old maybe you want to try this one https://help.forumotion.com/t131191-add-a-word-counter-to-the-editor?highlight=editor+limit
Re: Words problem in Javascript
skouliki wrote:hello
the code is old maybe you want to try this one https://help.forumotion.com/t131191-add-a-word-counter-to-the-editor?highlight=editor+limit
thank you for your reply @skouliki
I try,and I find it can't count words in chinese.
Is it because Chinese belongs to Pinyin?
Even if my word count reaches the limit target (at least 5 words),【green】
Still did not count any 1 word.【red】
Re: Words problem in Javascript
may i ask...is your forum language set in Chinese as well ? from the admin panel
TonnyKamper likes this post
Re: Words problem in Javascript
Yes,it is in chinese set.skouliki wrote:may i ask...is your forum language set in Chinese as well ? from the admin panel
And,I just found out recently.
I have to switch editing mode(in Code mode),it can calculate.(Some times)
Is this normal?
Thank your reply @skouliki
Re: Words problem in Javascript
i really dont know why the code is not working properly with Chinese but i will tag my friend @pedxz he is a good coder and he might help you with this
tikky likes this post
Re: Words problem in Javascript
Hello @Winging!
In the code find:
In the code find:
- Code:
var regex = new RegExp('\\w{' + LetterCountPerWord + ',}\\b', 'g');
- Code:
var regex = /[^\x00-\xff]/g;
TonnyKamper likes this post
Re: Words problem in Javascript
wow! Thank @pedxzpedxz wrote:Hello @Winging!
In the code find:replace to:
- Code:
var regex = new RegExp('\\w{' + LetterCountPerWord + ',}\\b', 'g');
- Code:
var regex = /[^\x00-\xff]/g;
This can work,and solved my problem.
You are very smart!!!
Thank you very much.
And I am also grateful @skouliki @SarkZKalie very much.
You are very friendly.
(And I will mark solved )
SarkZKalie and tikky like this post
Re: Words problem in Javascript
Forum of the Forums Forumotion Rules | Tips & Tricks | FAQ | Did you forget your password? |
*** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
No support via PM!
tikky likes this post
Similar topics
» Problem with javascript which counts the words
» Words before nick problem
» Problem censoring words
» JavaScript problem!
» Christmas Javascript Problem
» Words before nick problem
» Problem censoring words
» JavaScript problem!
» Christmas Javascript Problem
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum