title: Form Validation Jquery in html
body: <p>I am new to JQuery and I want to use validation in html form</p>
  
  <p>Here is my code but it is not working .I added jquery validate but it's not working.
  I am new to JQuery and I want to use validation in html form</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;script type="text/javascript"&gt;
              function ValidateForm(){
                  var flag1 = 1;
                  var flag2 = 1;
                  var user_name = document.forms["form-login"]["Username"].value;
                  var password = document.forms["form-login"]["Password"].value
                  if (user_name == null || user_name == "") {
                      flag1 = 0;
                      return false;
                  }
                  if (password == null || password == "") {
                      flag2 = 0;
                      return false;
                  }
                  return true;
              }
          &lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;h3&gt;Already A Member?&lt;/h3&gt;
          &lt;form name="form-login" id="form-login" action="check_login.php" onSubmit="return ValidateForm()" method="post"&gt;
              &lt;div class="form-login"&gt;
                  &lt;label for ="Username"&gt;UserName&lt;/label&gt;
                  &lt;br&gt;
                  &lt;input type="text" class="form-login-control" id="Username" placeholder="Enter Username"&gt;
                  &lt;br&gt;&lt;br&gt;
              &lt;/div&gt;
              &lt;div class="form-login"&gt;
                  &lt;label for ="Password"&gt;Password&lt;/label&gt;
                  &lt;br&gt;
                  &lt;input type="password" class="form-login-control" id="Password" placeholder="Enter Password"&gt;
                  &lt;br&gt;&lt;br&gt;
              &lt;/div&gt;
              &lt;button type="submit"&gt;
                  Submit
              &lt;/button&gt;
          &lt;/form&gt;
          &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.8/jquery.validate.min.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript"&gt;
              $(document).ready(function(){
                  $("#form-login").validate({
                      rules: {
                          "Username": {
                              required: true,
                          },
                          "Password": {
                              required: true,
                              minlegth: 5
                          }
                      }
                  });
              });
          &lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>