...

View Full Version : prohibit two words



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

jamescover
10-30-2004, 02:50 AM
This should have been asked in your previous thread:

http://www.codingforums.com/showthread.php?t=46816

For starting a new thread, you get 2 demerits, and I'm not answering your second question. :eek:



-james

joonstar
10-30-2004, 02:56 AM
This should have been asked in your previous thread:

http://www.codingforums.com/showthread.php?t=46816

For starting a new thread, you get 2 demerits, and I'm not answering your second question. :eek:



-james


I don't quite understand.
The previous post was about one prohibited word.
This is about two prohibited word.
So I thought this is a new post.

Should I post it as related post to the previous post?

Philip M
10-30-2004, 08:36 AM
Give my greedy up

Definitely! That would be my advice every time.

And please don't thank people who you want to oblige you with a favour IN ADVANCE. The time to make your gratitude known is AFTER the assistance has been supplied. Thanks in advance for not thanking people in advance in future.

fci
10-30-2004, 09:07 AM
take a look here... found it when I was looking for something else
http://blazonry.com/javascript/validform.php



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum