title: Javascript- Uncaught ReferenceError is not defined form validation
body: <p>Someone please help, i have no clue whats going on, I've done alot of research. I'm trying to do a form validation using <code>onblur</code>, so when I click off the screen, the <code>validateName()</code> function runs and does what I want. But instead all i get is <code>validateName()</code> is not defined, or <code>validateName().value</code> is not defined. I would really appreciate suggestions in this regard.</p>
  
  <ul>
  <li><p>Also when im linking a java script file with this code to this php file it is not working, probably same issue though. 
  -</p></li>
  <li><p>Full error message Uncaught ReferenceError: validateName is not defined
  at HTMLInputElement.onblur (account.php?fName=asas:52)
  onblur @ account.php?fName=asas:52 </p>
  
  <p>
  
  
      Capstone Website | Title Undetermined
      
      </p>
  
  <pre><code>&lt;link rel="icon" href="images/hammerFavicon.ico" type="image/gif"&gt;
  
  &lt;link rel="stylesheet" href="css/custom/siteStyle.css"&gt;
  &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascipt" src="js/main.js"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascipt" language="javascript"&gt;
      function validateName(fName) {
          var fName = form.fName.value;
          alert("fName");
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>
  
  </p>
  
  
  
  <p></p>
  
  
  
  <p>
  
      </p>
  
  <pre><code>    &lt;p class="lead"&gt;Account Details&lt;/p&gt;
  
      &lt;form&gt;
          &lt;!---- First name and Last name ---&gt;
          &lt;div class="form-row"&gt;
              &lt;div class="col"&gt;
                  &lt;label for="firstName"&gt;First Name&lt;/label&gt;
                  &lt;input type="text" onblur="validateName()" name="fName" id="fName" class="form-control"
                         placeholder="First name"/&gt;
              &lt;/div&gt;
  
              &lt;div class="col"&gt;
                  &lt;label for="firstName"&gt;Last Name&lt;/label&gt;
                  &lt;input type="text" class="form-control" placeholder="Last name" required maxlength="50"/&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;br&gt;
          &lt;!---- Email ---&gt;
          &lt;div class="form-row"&gt;
              &lt;div class="form-group col-md-6"&gt;
  
                  &lt;label for="inputEmail4"&gt;Email&lt;/label&gt;
                  &lt;input type="email" class="form-control" id="inputEmail4" placeholder="Email" required
                         maxlength="254"/&gt;
  
              &lt;/div&gt;
              &lt;!---- Password ---&gt;
              &lt;div class="form-group col-md-6"&gt;
  
                  &lt;label for="inputPassword4"&gt;Password&lt;/label&gt;
                  &lt;input type="password" class="form-control" id="inputPassword4" placeholder="Password"/&gt;
  
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;!---- Address ---&gt;
          &lt;div class="form-group"&gt;
  
              &lt;label for="inputAddress"&gt;Address&lt;/label&gt;
              &lt;input type="text" class="form-control" id="inputAddress" placeholder="1234 Main St" required
                     maxlength="100"/&gt;
  
          &lt;/div&gt;
          &lt;!---- Address 2 ---&gt;
          &lt;div class="form-group"&gt;
  
              &lt;label for="inputAddress2"&gt;Address 2&lt;/label&gt;
              &lt;input type="text" class="form-control" id="inputAddress2" placeholder="Apartment, studio, or floor"
                     required maxlength="100"/&gt;
  
          &lt;/div&gt;
          &lt;!---- City---&gt;
          &lt;div class="form-row"&gt;
              &lt;div class="form-group col-md-6"&gt;
  
                  &lt;label for="inputCity"&gt;City&lt;/label&gt;
                  &lt;input type="text" class="form-control" id="inputCity" required maxlength="100"/&gt;
  
              &lt;/div&gt;
              &lt;!---- State ---&gt;
              &lt;div class="form-group col-md-4"&gt;
  
                  &lt;label for="inputState"&gt;State&lt;/label&gt;
                  &lt;select id="inputState" class="form-control" required&gt;
                      &lt;option selected&gt;Choose...&lt;/option&gt;
                      &lt;option&gt;...&lt;/option&gt;
  
                  &lt;/select&gt;
              &lt;/div&gt;
              &lt;!---- Zip code ---&gt;
              &lt;div class="form-group col-md-2"&gt;
  
                  &lt;label for="inputZip"&gt;Zip&lt;/label&gt;
                  &lt;input type="text" class="form-control" id="inputZip" required maxlength="12"/&gt;
  
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;!---- Button ---&gt;
          &lt;button type="submit" class="button button-block"&gt;Update&lt;/button&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p></p>
  
  
  
  <p></p>
  
  <p></p></li>
  </ul>