Page 1 of 11
uCoz Community » uCoz Modules » Forum » Illegal words on Forum
Illegal words on Forum
Susmoy
Posts: 185
Reputation: 6

Message # 1 | 5:40 PM
Hi there,

In my site many users post Illegal words on their massage and I have all ready blocked those words on URL Blocking.
But Is this is possible that, "If someone type any Illegal word then a Ajax window will pop up on right corner in below and Saying that, 'Illegal words not allowed' "

If there is any problem to understand what I'm trying to say then please reply

Best Regards
-------------------
Susmoy

If I Help you then Please +Rep and Awards
e-surfer
Posts: 27
Reputation: 0

Message # 2 | 6:11 PM
ok i will give you a script

<form name = "myform">
<textarea id = "txt1" rows = "10" cols = "60"></textarea>
<br><br>
<input type = "button" id = "but1" value = "Check the text for smut" onclick="noHTML();smutfilter()">
</form>

<script type = "text/javascript">

function noHTML() {
txt=document.myform.txt1.value;
txt = txt.replace(/\<|\>/g," ");
txt = txt.replace(/\sscript\s/gi,"");
txt = txt.replace(/\sdiv\s/gi,"");
// similarly delete any other unwanted tags
document.myform.txt1.value = txt;
}

function smutfilter() {
var smut="*#*?*&*%*!*#*?*&*%*!*#*?*&*%*!";
var badnum=0;

// Make your list of bad words here. Note each bad word is separated by a space with a final space at the end. Note also that upper case initial characters can be overcome by testing only for the remaining ones e.g. obacco, ottery etc.

cmp="Nazi nazi REE obacco igarette pics pix ortgage debt loan lucky wager gaming asino drug lcohol addict ";
txt=document.myform.txt1.value;
for (var i=0;i<17;i++) { // 17 is number of bad words in the list - must be correct or browser may crash!pos=cmp.indexOf(" ");
wrd=cmp.substring(0,pos);
wrdl=wrd.length;
cmp=cmp.substring(pos+1,cmp.length);
while (txt.indexOf(wrd)>-1) {
pos=txt.indexOf(wrd);
txt=txt.substring(0,pos)+smut.substring(0,wrdl)+txt.substring((pos+wrdl),txt.length);
badnum = badnum+1; // count number of bad words
}
}
document.myform.txt1.value = txt;
}
</script>

don't forget to increase my rep and give an award if i helped smile

internet my mom and html are my weak points : www.isurfer.tk
Blazer
Posts: 310
Reputation: 25

Message # 3 | 7:28 PM
e-surfer, where to put that script ?
If i helped you + My Reputation and Give me an Award.
e-surfer
Posts: 27
Reputation: 0

Message # 4 | 7:56 PM
add it to the forum page but Remember that JavaScript form validation only provides convenience for users, not security. This means that JavaScript should be used as an "enhancement", not as a requirement. So your form should not be dependent on JavaScript alone to perform your validation. Instead, whatever server-side language you use to process the form (PERL, ASP, PHP, etc.) should also perform the same validation. Otherwise, people will be able to bypass your validation (and even possibly inject malicious code) simply by disabling JavaScript.
internet my mom and html are my weak points : www.isurfer.tk
Susmoy
Posts: 185
Reputation: 6

Message # 5 | 4:27 AM
e-surfer, I don't understand, Why you gave me that code? I asked for Ajax Pop up not for those kinds of Box
If I Help you then Please +Rep and Awards
e-surfer
Posts: 27
Reputation: 0

Message # 6 | 8:32 AM
don't you want to dissallow bad words in your forum
internet my mom and html are my weak points : www.isurfer.tk
CodeResolution
Posts: 1570
Reputation: 58

Message # 7 | 9:09 AM
Susmoy, we do not help with custom coding, although you may get a good answer by requesting a script in the following thread - http://forum.ucoz.com/forum/25-13186-1
Kind regards,
Elliott.

"The best uCoz" critic since 2007.
Qualified website, branding, print & user interface designer.

I'm on Behance and Twitter.
Natashko
Posts: 3366
Reputation: 171

Message # 8 | 9:16 AM
Susmoy, your request can be achieved by means of custom coding and scripting only. I am not sure that the provided above script will help you. And we do not provide help with scripts as well. So search it elsewhere.
Susmoy
Posts: 185
Reputation: 6

Message # 9 | 3:12 PM
Natashko, Oh Sure Ma'am..Thanks for Reply.. and Thank you CreativeCollusions,
If I Help you then Please +Rep and Awards
uCoz Community » uCoz Modules » Forum » Illegal words on Forum
Page 1 of 11
Search: