File: /srv/www/rectt-csmcri.res.in/public_html/js/login.js
$(document).ready(function () {
$("#submit").click(function (e) {
e.preventDefault(); // Prevent default form submission
var email = $("#myemail").val();
var password = $("#mypassword").val();
var ad_id = $("#ad_id").val();
if ((email == "") || (password == "") || (ad_id === "")) {
$("#message").html("<div class=\"alert alert-danger alert-dismissable\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">×</button>Please fill all the fields including advertisement selection</div>");
}
else {
$.ajax({
type: "POST",
url: "checklogin.php",
data: { myemail: email, mypassword: password, ad_id: ad_id },
success: function (html) {
if (html.trim() === "<!-- <!DOCTYPE html> -->true") {
window.location.href = "primary.php";
} else {
$("#message").html(html); // Display error message
}
}
,
beforeSend: function () {
}
});
}
return false;
});
});