javascript - After submit the login page Getting error as HTTP Error 405.0 - Method Not Allowed -


working on login page using jquery validate plugin. after enter correct username , password validation working fine created of jquery validate. page nto redirect success page.

i getting error http error 405.0 - method not allowed

here code

 $(document).ready(function () {              $("#form1").validate({                  debug: false,                  errorclass: "error error_red",                  rules: {                      username: {                          required: true,                          email: true                      },                      password: {                          required: true,                          minlength: 5                      }                  },                  messages: {                      username: "please enter valid email address",                      password: {                          required: "please provide password",                          minlength: "your password must @ least 5 characters long"                      },                       success: function (data) { // demo                          $('#username').focus();                      }                  }              });              $('#submit').click(function () {                  alert("check click");                  var valemail = $('#username').val() == 'admin@admin.com'; // email value                  alert("email" + valemail);                  var valpassword = $('#password').val() === 'admin'; // password value                  if (valemail === true && valpassword === true) { // if valemail & val valpass above                      alert('valid!'); // alert valid!                      var site_url = 'http://localhost:55170/home_page.html';                      alert("site_url" + site_url);                      jquery("#submit").click(function (event) {                          alert("submit click" + jquery("#submit").click);                          window.location.href = site_url + "event-form";                      });                      // go home.html                  }                  else {                      alert('not valid!'); // alert not valid!                  }              });          }); 

here fiddle link

thanks in advance m

i altered code. try this... problems

  • you using '===' comparing password.
  • you using same '===' in if condition loop
$('#submit').click(function () {                      alert("check click");                      var valemail = $('#username').val() == 'admin@admin.com'; // email value                      alert("email" + valemail);                      var valpassword = $('#password').val() == 'admin'; // password value                      if (valemail == true && valpassword == true) { // if valemail & val valpass above                          alert('valid!'); // alert valid!                          var site_url = 'home_page.html';                          alert("site_url" + site_url);                          jquery("#submit").click(function (event) {                              alert("submit click" + jquery("#submit").click);                              window.location.href = site_url + "event-form";                          });                          // go home.html                      }                      else {                          alert('not valid!'); // alert not valid!                      }                  }); 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -