title: Javascript return false - from function
body: <p>Is there any way to do the following:</p>
  
  <pre><code>validateLogin();
  return false;
  </code></pre>
  
  <p>But actually like this..</p>
  
  <pre><code>validateLogin();
  </code></pre>
  
  <p>And here is the function:</p>
  
  <pre><code>function validateLogin(){
  if(hi=true){
  return true;
  }
  else{
  return false
  }
  </code></pre>
  
  <p>I want to attach this function for the event of a form being submitted, so if HI is false - i want to return false; meaning it will stop for form from submitting.. i know return false; will do so i just need to know how i can get this return back to the parent function?</p>
  
  <p>Thanks in advance!</p>