title: validate login & redirect to success page using jquery validate plugin
body: <p>I am new to advance level of jQuery scripting and here I am using jquery validation for my login page.</p>
  
  <p>If my login page was success it has to redirect to success page the code was working fine with the below code when I click submit button . </p>
  
  <pre><code>&lt;form id="form1" name="login" method="post" action="mainpage.html"&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>Here is my code</p>
  
  <pre><code>$(function (){
       $("#form1").validate({
      // Specify the validation rules
      rules: {
          username: {
              required: true,
              email: true
          },
          password: {
              required: true,
              minlength: 5
          }
      },
  
      // Specify the validation error messages
      messages: {
          username: "Please enter a valid email address",
          password: {
              required: "Please provide a password",
              minlength: "Your password must be at least 5 characters long"
          },
            submitHandler: function (form) { // for demo
                           $('#username').focus();
                           $('#submit').click(function () {
                               event.preventDefault(); // prevent PageReLoad                                
                               var ValEmail = $('#username').val() === 'admin@admin.com'; // Email Value
                               alert("Email" + ValEmail);
                               var ValPassword = $('#password').val() === 'admin1234'; // Password Value
                               if (ValEmail === true &amp;&amp; ValPassword === true) { // if ValEmail &amp; Val ValPass are as above
                                   alert('valid!'); // alert valid!
                                   window.location.href = "http://java67.blogspot.com";
                                   // go to home.html
                               }
                               else {
                                   alert('not valid!'); // alert not valid!
                               }
                           });
                       }
      }
  });
  
  });
  </code></pre>
  
  <p>But I need to do validation example if emailid = admin@admin.com &amp; passsword = admin1234 when I click the submit it needs to check whether my emailid was John@xyz.com and passsword was password if both was successful it has to redirect, else it has to show error message in the label.</p>
  
  <p>Now I am getting the error as HTTP Error 405.0 - Method Not Allowed</p>
  
  <p>Here is the Fiddle <a href="http://jsfiddle.net/karthic2914/ny9bt1ak/4/" rel="nofollow">Link</a></p>
  
  <p>Thanks in advance</p>
  
  <p>Regards
  M</p>