Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-30-2004, 02:45 AM   PM User | #1
joonstar
Regular Coder

 
Join Date: Apr 2003
Location: Seoul, Korea
Posts: 329
Thanks: 0
Thanked 0 Times in 0 Posts
joonstar is an unknown quantity at this point
prohibit two words

Code:
<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.
Code:
illChar = "FK,ST";
Thanks in Advance
__________________
Get my greedy up
joonstar is offline   Reply With Quote
Old 10-30-2004, 02:50 AM   PM User | #2
jamescover
Regular Coder

 
Join Date: Aug 2002
Location: USA
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
jamescover is an unknown quantity at this point
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.



-james
__________________
"God so loved the world that he gave his only begotten son, so that whosoever believed in him would not perish, but have everlasting life. For God did not send his son into the world to condemn the world, but so that through him the world might be saved. "
jamescover is offline   Reply With Quote
Old 10-30-2004, 02:56 AM   PM User | #3
joonstar
Regular Coder

 
Join Date: Apr 2003
Location: Seoul, Korea
Posts: 329
Thanks: 0
Thanked 0 Times in 0 Posts
joonstar is an unknown quantity at this point
Quote:
Originally Posted by jamescover
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.



-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?
__________________
Get my greedy up
joonstar is offline   Reply With Quote
Old 10-30-2004, 08:36 AM   PM User | #4
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,036
Thanks: 197
Thanked 2,411 Times in 2,389 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
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.

Last edited by Philip M; 10-30-2004 at 08:42 AM..
Philip M is offline   Reply With Quote
Old 10-30-2004, 09:07 AM   PM User | #5
fci
Senior Coder

 
Join Date: Aug 2004
Location: Twin Cities
Posts: 1,345
Thanks: 0
Thanked 0 Times in 0 Posts
fci is an unknown quantity at this point
take a look here... found it when I was looking for something else
http://blazonry.com/javascript/validform.php
fci is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:14 AM.


Advertisement
Log in to turn off these ads.