Issues with JavaScript Form Validation
<p>I am trying to do Form validation to validate the information request form by checking that the following fields in the form have been filled out:</p>

<p>▪ Name field<br>
▪ Email field<br>
▪ Comments</p>

<p>My function validateName() does not work at all it causes the other functions not to work either (adding default values to fields and removal of defaults when text area is clicked). When I remove the validateName() the functions I previously created work fine.  It should be noted that I have addded the onsubmit="return validateName()" to the form element. I will also need to create a validateEmail() and validateComments() respectively.</p>

<p>I would also like the function for validateName(), validateEmail(), and validateComments() validation to check the following:</p>

<p>▪ Check if the form field is empty when submitted 
▪ Check if the default text is in the form field when submitted </p>

<p>I have commented out the 2 validateName() functions I attempted to use so my other functions will work.</p>

<pre><code>    function formtext(){
        document.contact.Name.value="Enter your name.";
        document.contact.Email.value="Enter your email address.";
        document.contact.questions.value="Enter your comments.";
    }
    function delete_email(){
        document.contact.Email.value = "";
    }
    function delete_name(){
        document.contact.Name.value = "";
    }
    function delete_comments(){
        document.contact.questions.value = "";
    }

   /* function validateName()
    {
        var x=document.contact.Name.value;
        if (x==null || x=="")

        {
            alert("Name must be filled out");
            return false;
        }
    }  */

    /* function validateName()
    {
        var x=document.contact.["Name"].value;
        if (x==null || x=="")
        {
            alert("Name must be filled out");
            return false;
        }
    }    */

&lt;/script&gt;
</code></pre>
