title: Validations for Password and First name using JavaScript
body: <p>I am doing form validations and the requirement is 
          1.Email : Email must be a valid Email ID.
          2.Password : Must be eight characters long. Only number(0-9) and letters(A-Z,a-z) are allowed.
          3.FirstName : Must not contain any numbers(0-9).
          4.LastName : Must not contain any numbers (0-9).
  I did for email Address and I am struck with the password and FirstName validations..
          Can Anyone help me in this Thanks in Advance. </p>
  
  <pre><code>    &lt;form&gt;
              &lt;label for=""&gt;First Name&lt;/label&gt;
              &lt;input type="text" id="fname"&gt;&lt;br&gt;
              &lt;label for=""&gt;Last Name&lt;/label&gt;
              &lt;input type="text" id="lname"&gt;&lt;br&gt;
              &lt;label for=""&gt;Email&lt;/label&gt;
              &lt;input type="text" id="email"&gt;&lt;br&gt;
              &lt;label for=""&gt;Password&lt;/label&gt;
              &lt;input type="text" id="password"&gt;&lt;br&gt;
             &lt;button type="button" onclick="claim()"&gt;Claim Your Free Trail&lt;/button&gt;
             &lt;p&gt;You Are Agreeing to Our &lt;a href="#"&gt;Terms &amp; Condition&lt;/a&gt;&lt;/p&gt;
          &lt;/form&gt;
  
          &lt;script&gt;
              function claim(){
                  var obj ={
                      fname:"",
                      lname:"",
                      email:"",
                      password:""
                  }
  
                  for(a in obj){
                      obj[a]=document.getElementById(a).value
                  }
                  if(obj.email.match(/@/) != null){
  
                  }else{
                      alert("Please enter Valid Email Address")
                  }
                  console.log(obj)
              }
          &lt;/script&gt;
      &lt;/body&gt;
  </code></pre>