L. Spiro
May 17th, 2008, 08:43
I am really quite sick of fag bots posting on my forums and I want to edit my posting_body.tpl to disallow posts containing certain text.
I need to modify the checkForm() function to scan for key words and then error (even if the error report makes no sense, I don’t really care).
I had this:
It fails (no error thrown but always allows posts even when containing the offensive text).
Anyone know how to get this to work?
L. Spiro
I need to modify the checkForm() function to scan for key words and then error (even if the error report makes no sense, I don’t really care).
I had this:
Code:
function checkForm() {
formErrors = false;
if (document.post.message.value.length < 2) {
formErrors = "{L_EMPTY_MESSAGE}";
}
if (stristr(document.post.message.value, 'sex') !== FALSE) {
formErrors = "{L_EMPTY_MESSAGE}";
}
if (formErrors) {
alert(formErrors);
return false;
} else {
bbstyle(-1);
//formObj.preview.disabled = true;
//formObj.submit.disabled = true;
return true;
}
}
It fails (no error thrown but always allows posts even when containing the offensive text).
Anyone know how to get this to work?
L. Spiro