title: Create alert message in javascript
body: <p>I am very new to this and was given the task to "help".<br>
  What the script does is it generates a form based on the input given (in Internet Explorer 8).<br>
  The only problem I have is, when a person types into the text field, say for a day of the week, if it's left blank, misspelled or just doesn't match the list tied to it, then it will still generate the form but that field will come out as "undefined".<br>
  What they type is tied to a list in the script that determines what the output info is.<br>
  I'm trying to figure out how to create an alert saying "Doesn't match" or "enter info", if it doesn't match the list or is left blank.<br>
  Any starting point would be greatly appreciated! I've looked and tried different validations, but nothing that will tie to the list.</p>
  
  <pre><code>function getDay(weekcode) {
      var DayHash={
          'Monday':'df',
          'Tuesday':'fg',
          'Wednesday':'gh',
          'Thursday':'hjt',
          'Friday':'jk',
          'Saturday':'x3D',
          'Sunday':'Crt',
      }
  }
  </code></pre>