title: Notification alert messages for HTML
body: <p>Just wondering if anybody knows any tutorials or scripts where I can get form notifications.</p>
  
  <p>Pretty much what I want is when someone types in particular keywords in a form then it needs to come up with a message.</p>
  
  <p>What I want to do is when a viewer types in the following keywords into a form; </p>
  
  <pre><code>Medlab Central 
  Medlab Wanganui 
  Naylor Lawrence 
  Doughboys Bakery Limited – owners surname ‘Funke’ 
  Denver Stockfeeds Limited – owners surname ‘Currie’ 
  Midland Civil Limited – Miles and Vicky Worsley 
  Arran Trust – Stephen and Mary Barr 
  Roadmarking Services Limited – Karen and Kelly halligan 
  Steeds Pharmacy Ltd 
  </code></pre>
  
  <p>I want a notification to popup saying 'There may be a conflict of interest. Please wait to hear from Proa regarding how they can help'</p>
  
  <hr>
  
  <p>Had a quick go, is this the correct coding for HTML;</p>
  
  <pre><code>&lt;form id="theForm"&gt;
      &lt;input type="text" /&gt;
      &lt;input type="submit" value="Send Email"&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  
  &lt;script&gt;
  var specialWords = ["hello", "goodbye"];
  $(function(){
      $('#theForm').on("change keyup", "input[type='text']", function(event){
          var inputValue = $(this).val();
          if($.inArray(inputValue, specialWords) &gt; -1){
              alert(inputValue + " is a special word!");
          }
      });
  });
  &lt;/script&gt;
  &lt;/html&gt;
  </code></pre>
  
  <hr>
  
  <p>I have found a script that works..</p>
  
  <pre><code>&lt;script language="JavaScript"&gt;
  var nav=navigator.appName;
  var ns=(nav.indexOf("Netscape")!=-1);
  
  if(ns){
  if(document.layers){
  document.captureEvents(Event.KEYPRESS);
  document.onkeypress = cheat;
  }
  if(document.getElementById){
  document.onkeypress = cheat;
  }
  }
  else
  {document.onkeypress = cheat;}
  
  var SpecialWords = "here"
  var SpecialLetter = 0;
  var vcheat = false
  function cheat(keyStroke)
  {
   var eventChooser = (ns)?keyStroke.which: event.keyCode;
   var which = String.fromCharCode(eventChooser).toLowerCase();
   if(which == SpecialWord.charAt(SpecialLetter)){
     SpecialLetter++;
     if (SpecialLetter == SpecialWord.length) alert("There may be a conflict of interest. Please wait to hear from PROA regarding how they can help")
  }
  else {SpecialLetter = 0;vcheat = false}
  
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>however I now need it to work for multiple specialwords. I tried to do what Mark said which was</p>
  
  <pre><code>var specialWords = ["hello", "goodbye"];
  </code></pre>
  
  <p>but wouldnt work . any suggestions.</p>