how to check for null value in javascript
<p>I am creating and registration form in java script want i want is to check that any of the fields should not be null 
the code is here </p>

<pre><code>    enter code herefunction Savedata()
{
    var nameval= new String();
    var name1=document.getElementById("name").value;
    var email=document.getElementById("email").value;
    var designaton=document.getElementById("designation").value;
    var passwrd=document.getElementById("password").value;
    var confrmpasswrd=document.getElementById("cnfrmpassword").value;
    var DOB=document.getElementById("date").value;
    var atdrate=email.indexof("@");
    var dot=email.lastindexof(".");
     if(nameval != null)
        {
            alert("Enter only Characters");
        }else if(atdrate!=email || dot!=email)
        {
            alert("Enter valid Email ");
        }
        else if(designaton!=nameval){
            alert("Enter only charaters in designation");
        }else if(password!=confrmpassword){
            alert("Password and conformPassword doesnt match");
        }

}
</code></pre>
