Hi
I have developed some form validation code which checks for the presence of inappropriate words entered in to a textarea. However, as I am a novice to Javascript, I am unable to check for the likes of asterix (*) or underscore (_) within a word such as ‘talking cr*p’ or ‘bullsh_t’.
Also, occasionally a user may submit a link to an inappropriate web site in to the textarea, whilst I do not mind a user mentioning the name of their site, I think that it would be best to not allow a user to enter ‘http’ or ‘www’. I would be very grateful for any help with this.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script type="text/javascript">
<!--
function search(obj)
{
var foul_words=new Array();
foul_words[0]="dog"
foul_words[1]="cat"
foul_words[2]="fish"
foul_words[3]="sheep"
foul_words[4]="duck"

for(x=0;x<5;x++)
{
if(obj.value.toLowerCase().indexOf(foul_words[x])!=-1)
{
alert(foul_words[x]+" is a foul or abusive word, please be more selective in your wording.");
obj.select();
return false; //This prevents the form from being submitted
}
}
}
//-->
</script>
</head>

<body>
<form>
Comments:
<textarea name="comments" cols="37" rows="8" onBlur="search(this);"></textarea>
<br><br>
More Input:
<input type="text" name="another_textbox" size="30" maxlength="30">
<br><br>
<input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>