joonstar
10-30-2004, 02:45 AM
<script type="text/javascript">
<!--
function chkFrm(){
illChar = "FK";
var doc = document['oFrm'];
if(doc['say'].value.toUpperCase().indexOf(illChar,0) != -1){
alert(illChar + " is prohibited!");
return false;
}
}
//-->
</script>
<form name="oFrm" onsubmit="return chkFrm();" action="action.htm" method="post">
<textarea name="say" rows="10" cols="25"></textarea>
<br />
<input type="submit" value="Check Form" />
</form>
The above code probibits the word "FK."
Then, how can I prohibit two words "FK" and "ST."
I tried to change the prohibited word part like the following, but failed.
illChar = "FK,ST";
Thanks in Advance
<!--
function chkFrm(){
illChar = "FK";
var doc = document['oFrm'];
if(doc['say'].value.toUpperCase().indexOf(illChar,0) != -1){
alert(illChar + " is prohibited!");
return false;
}
}
//-->
</script>
<form name="oFrm" onsubmit="return chkFrm();" action="action.htm" method="post">
<textarea name="say" rows="10" cols="25"></textarea>
<br />
<input type="submit" value="Check Form" />
</form>
The above code probibits the word "FK."
Then, how can I prohibit two words "FK" and "ST."
I tried to change the prohibited word part like the following, but failed.
illChar = "FK,ST";
Thanks in Advance