How to prevent the user from repeating a character more than three times in the same word like this : "hiii" its possible, but "hiiii" not possible type in textbox,indicator is stopped.
I wnat like this site to add advertising
look the textbox : الإعلان *
I tried this code :
<input name="text1" type="text" class="mult">var mult = false,prev = 0; $('.mult').keydown(function(e) { if (!mult) { mult = true; prev = e.which; setTimeout(function() { mult = false; }, 10000) } else if (prev != e.which) { mult = false; } else { return false; } });But this code to prevent duplicate a character one times for same word with timeout. I want to prevent user when duplicate character more than three times in same word for ever, like (maxlength) in HTML .
when the user to type text and he wants to repeat the character in one word the indicator stops writing.