title: javascript return value Part 2
body: <p>Had some great help yesterday, and have a followup question/problem.  Regarding an HTML form, when the user clicks onSubmit="return outer()", the function 'outer' only returns one of the two functions inside (either checkname or checkpostal).  How do I get it to check both functions?  Noob question I'm sure, but I want to understand, and not just copy paste from the plethora of forms out there.</p>
  
  <pre><code>var postalconfig = /^\D{1}\d{1}\D{1}\-?\d{1}\D{1}\d{1}$/;
  
  function outer() {
      function checkname(f_name) {
          if (document.myform.f_name.value == "") {
              alert("Enter your First Name");
              return false;
          } else {
              alert("valid First Name");
              return true;
          }
      }
      return checkname();
  
      function checkpostal(postal_code) {
          if (postalconfig.test(document.myform.postal_code.value)) {
              alert("VALID postal");
              return true;
          } else {
              alert("INVALID postal");
              return false;
          }
      }
      return checkpostal();
  } //end of outer
  </code></pre>
  
  <p>The HTML:</p>
  
  <pre><code>&lt;form name="myform" action="index.php" onSubmit="return outer();" method="post"&gt;
    First Name
    &lt;input name="f_name"  type="text" /&gt;
    &lt;br /&gt;
    Telephone
    &lt;input name="telephone" type="text" /&gt;
    &lt;br /&gt;
     &lt;input name="Submit" type="submit"  value="Submit Form" &gt;
  &lt;/form&gt;
  </code></pre>