return value in javascript
<p>I am new to javascript and I am little bit confused about the syntax.</p>

<pre><code>function validateForm()
{
var x=document.forms["myForm"]["fname"].value
if (x==null || x=="")
  {
  alert("First name must be filled out");
  return false;
  }
}

&lt;form name="myForm" action="demo_form.asp" onsubmit="return validateForm()" method="post"&gt;
First name: &lt;input type="text" name="fname"&gt;
&lt;input type="submit" value="Submit"&gt;
&lt;/form&gt;
</code></pre>

<p>My question is If I write onsubmit="return validateForm()" or write onsubmit="validateForm()". What's the difference between these two syntax. So I submitted before just an example.</p>

<p>Here it is example</p>

<p>Event = function(); or Event = return function();</p>

<p>What's the difference between these two syntax</p>
