SeethaPartha

SeethaPartha

  • NA
  • 89
  • 30k

Redirect to another html page using jquery

Mar 9 2018 3:58 AM
i have a design bootstrap template. I want to redirect from login.html page to index.html. But it is nor working in jquery.
 
Please see below code i tried.
 
<button type="submit" id="submit" onclick="checkcredential()" class="btn">Sign in!</button>
 
function checkcredential() {
if ($('#l-form-3-username').val() == "" || $('#l-form-3-password').val() == "") {
alert("Please enter valid Credentaials")
}
else if ($('#l-form-3-username').val() != "admin" || $('#l-form-3-password').val() != "admin") {
alert("Invalid Credentials!!!")
}
else if ($('#l-form-3-username').val() == "admin" || $('#l-form-3-password').val() == "admin") {
window.location.href("index.html")
}
}
 
Kindly suggest some idea. Its Urgent.

Answers (3)