<HTML> <HEAD> <SCRIPT language="JavaScript" > <!-- function findBadWords(form) { var txt = form.inText.value; var pattern=/shit|damm|darn|stupid|bad|bitch|nincompoop|ass/ig if (txt.search(pattern) == -1) { //no bad words found text="No bad words. Good kid"; } else { text = txt.match(pattern); } document.form.outText.value = text; //replace inText bad words with ### var newstring=txt.replace(pattern,"###"); document.form.inText.value=newstring; } // --> </SCRIPT> </HEAD> <BODY bgcolor="#94d6ce"> <CENTER> <P><h4>Type text in these boxes. If you type a 'bad' word, <br>the sensor box will list all the occu rances of the 'bad' word</h4></P> <FORM NAME="form" ENCTYPE="multipart/form-data" METHOD=post> <TEXTAREA NAME="inText" COLS="25" ROWS="7">type shitty words, dammit!</TEXTAREA> <TEXTAREA NAME="outText" COLS="25" ROWS="7">sensor</TEXTAREA> <BR><INPUT TYPE="button" VALUE="Check for 'bad' words." onclick="findBadWords(this.form)"> </FORM> </CENTER> </BODY> </HTML>