title: Return true or false not working in JavaScript
body: <p>My return values are not working, and I need them to work so I can validate the page.  I have a function in a function because there will be more code written which will require that kind of setup.</p>
  
  <p>Here is the JavaScript code:</p>
  
  <pre><code>var postalconfig = /^\D{1}\d{1}\D{1}\-?\d{1}\D{1}\d{1}$/;
  
  function outer(){
      function checkpostal(postal_code){
        if (postalconfig.test(document.myform.postal_code.value)) {
          alert("VALID SSN");
          return true;
        } else {
          alert("INVALID SSN");
          return false;
        }
      }
    checkpostal();
  }
  </code></pre>
  
  <p>And the HTML:</p>
  
  <pre><code>&lt;form name="myform" action="index.php" onSubmit="return outer();" method="post"&gt;
      Postal Code &lt;input name="postal_code"  type="text" /&gt;
      &lt;input name="Submit" type="submit"  value="Submit Form" &gt;
  &lt;/form&gt;
  </code></pre>