javascript validation for empty input field
<p>Greeting,
I have this input field 
<code>&lt;input name="question"/&gt;</code> I want to call IsEmpty function when submit clicking submit button.</p>

<p>I tried the code below but did not work.
any advice?!</p>

<pre><code>&lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;&lt;/title&gt;
    &lt;meta http-equiv="Content-Type" content="text/html; charset=unicode"/&gt;
    &lt;meta content="CoffeeCup HTML Editor (www.coffeecup.com)" name="generator"/&gt;
  &lt;/head&gt;
  &lt;body&gt;


    &lt;script language="Javascript"&gt;

function IsEmpty(){ 

if(document.form.question.value == "")
{
alert("empty");
}
    return;
}


&lt;/script&gt;
Question: &lt;input name="question"/&gt; &lt;br/&gt;

&lt;input id="insert" onclick="IsEmpty();" type="submit" value="Add Question"/&gt; 

&lt;/body&gt;
&lt;/html&gt;
</code></pre>
