Uncaught Reference Error: validateform is not definded
<p>The code is very simple. But this is the first thing off this kind that I am doing, and I simply do not understand what it is that I am doing wrong.
Also this is the raw code straight from OCR.</p>

<p>This is GCSE computing coursework. I don't have to fix it, but I don't know how I'm supposed to test the stuff I'm going to add without the base code working.</p>

<pre><code>&lt;head&gt;
    &lt;title&gt;Exam entry&lt;/title&gt;
    &lt;script language="javascript" type="text/javascript"&gt;
        function validateForm(document) {
            var result = true;
            var msg = "";
            if (document.ExamEntry.name.value == "") {
                msg += "You must enter your name \n";
                document.ExamEntry.name.focus();
                document.getElementById(‘name’).style.color = "red";
                result = false;
            }
            if (document.ExamEntry.subject.value == "") {
                msg += "You must enter the subject \n";
                document.ExamEntry.subject.focus();
                document.getElementById(‘subject’).style.color = "red";
                result = false;
            }
            if (msg == "") {
                return result;
            } {
                alert(msg)
                return result;
            }
        }
    &lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
     &lt;h1&gt;Exam Entry Form&lt;/h1&gt;

    &lt;form name="ExamEntry" method="post" action="success.html"&gt;
        &lt;table width="50%" border="0"&gt;
            &lt;tr&gt;
                &lt;td id="name"&gt;Name&lt;/td&gt;
                &lt;td&gt;
                    &lt;input type="text" name="name" /&gt;
                &lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;td id="subject"&gt;Subject&lt;/td&gt;
                &lt;td&gt;
                    &lt;input type="text" name="subject" /&gt;
                &lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;td&gt;
                    &lt;input type="submit" name="Submit" value="Submit" onclick= return "validateForm()";  /&gt;
                &lt;/td&gt;
                &lt;td&gt;
                    &lt;input type="reset" name="Reset" value="Reset" /&gt;
                &lt;/td&gt;
            &lt;/tr&gt;
        &lt;/table&gt;
    &lt;/form&gt;
&lt;/body&gt;
</code></pre>
