Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Apr 2003
    Location
    Seoul, Korea
    Posts
    329
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  • #2
    Regular Coder
    Join Date
    Aug 2002
    Location
    USA
    Posts
    625
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This should have been asked in your previous thread:

    alert for prohibited word

    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. "

  • #3
    Regular Coder
    Join Date
    Apr 2003
    Location
    Seoul, Korea
    Posts
    329
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by jamescover
    This should have been asked in your previous thread:

    alert for prohibited word

    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

  • #4
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,017
    Thanks
    203
    Thanked 2,538 Times in 2,516 Posts
    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.

  • #5
    fci
    fci is offline
    Senior Coder
    Join Date
    Aug 2004
    Location
    Twin Cities
    Posts
    1,345
    Thanks
    0
    Thanked 0 Times in 0 Posts
    take a look here... found it when I was looking for something else
    http://blazonry.com/javascript/validform.php


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •