string replace
Moderator: General Moderators
string replace
any one got an idea how i can use javascript onSubmit to replace all bad words in the textarea field?
Why do you want to do this using Javascript. Someone can send the text with bad words omitting you anti-bad-word-system. It's better to do it with PHP e.g.:
Or you can have those bad words in the table and make a loop.
Code: Select all
$good_txt = preg_replace("(bad_word1|bad_word2|bad_word3)i","[censored]",$_POST['textarea_bad_txt']);