屏蔽关键字,大概的思路就是去用javascript去替换已有的文本,达到替换的目的
<script language="javascript1.2"><!--
function test() {
if((a.b.value.indexOf ("***") == 0)||(a.b.value.indexOf ("****") == 0)){
alert(":)");
a.b.focus();
return false;}
}
// --></script>
<form name=a onsubmit="return test()">
<input type=text name=b>
<input type="submit" name="Submit" value="check">
</form>