javascript error message is not showing up
<p>I am trying to make an error if the textbox (First_Name) is left empty. For example, if the firstname field is left empty, the user will receive the following error: "Please enter your first name" Nothing happens when I click the submit button after leaving the field blank though...</p>

<pre><code>&lt;HTML&gt;
&lt;HEAD&gt;
&lt;TITLE&gt;this is a test page&lt;/TITLE&gt;
&lt;script language="javascript" type="text/javascript"&gt;
&lt;!--
function CheckForm()
{
  var formObj = document.getElementById("Data");
  var firstname = formObj.FIRST_Name.value;

    if(notEmpty(firstname, "Please enter your first name")){                        

    return true;}

    return false;
    }

function notEmpty(elem, helperMsg){
    if(elem.value.length == 0){
        alert(helperMsg);
        elem.focus(); // set the focus to this input
        return false;
    }
    return true;
}

&lt;/script&gt;
&lt;/HEAD&gt;
&lt;BODY&gt;
&lt;div style="background: #CCCC99"&gt;
&lt;HR&gt;&lt;FORM id="Data" onsubmit="return CheckForm()" &gt;
&lt;P&gt;First Name: &lt;input type=text name=FIRST_Name maxlength=15 size=15&gt;
&lt;/P&gt;
&lt;input type=submit value="Submit Products Registration Form" style="width: 220px"&gt;&lt;input type=reset value="Reset"&gt;
&lt;/form&gt;
&lt;/div&gt;
&lt;/BODY&gt;
&lt;/HTML&gt;
</code></pre>
