I am just practicing js. I am trying to make a very simple validation in form but it came with, as i was expecting, an error. 
Here's my code : 

```js
var form = document.getElementById('form');
var name = document.getElementById('name');
var email = document.getElementById('email');   
var msg = document.getElementById('message');
var error = document.getElementById('error');

function handlingForm() {

    form.onsubmit = function(c) 
    {
        if (name.value == "") 
            {
                error.innerHTML = "Error Submiting Form !";
                return false;
            }
            else
            {
                error.innerHTML = "You have successfuly submited the Form..! Congrats ;)";
                return true; // ;) Just Kidding :D
            }

    };
}   

window.onload = function(c)
{
    handlingForm();
}
```

```html
<!DOCTYPE html>
<html>
<head>
    <title>jsForm</title>

    <link rel="stylesheet" type="text/css" href="style.css">

</head>
<body>

    <div id="container">

        <form id="form">

            <input type="text" placeholder="Name" id="name">
            <input type="text" placeholder="Email" id="email">
            <textarea rows="4" placeholder="Message" id="message"></textarea>
            <input type="submit" value="Send" id="send">
            <p id="error"></p>
        </form>

    </div>  

    <script src="script.js"></script>
</body>
</html>
```

The problem is that, it doesn't validate it. Every time it returns true on submitting but when i replace the " name.value" with "email.value" the code works. I don't know now what's the problem actually. If someone could help me..