$(document).ready(function () { ClearData(); $("#btnSubmit").click(function () { CheckResult(); return false; }); $("#btnSubmit").keydown(function (e) { if (e.which == 13) { CheckResult(); return false; } }); $("#btnForgetRegistrationNoLink").click(function (e) { $("#ForgotRegistrationNo").modal('show'); }); $("#btnOk").click(function (e) { ForgotRegistrationNo(); }); $("#btnclose").click(function (e) { $("#ForgotRegistrationNo").modal('hide'); }); }); function CheckResult() { try { BlockUI(); $.post(CommonURL + "Dashboard/ShowResult", AddAntiForgeryToken({ RegistrationNo: $("#txtRegistrationNo").val(), DateOfBirth: $("#txtDateOfBirth").val(), CapText:$("#txtCaptcha").val() }), function (data) { if (data.Result == "Expired") { SessionExpire(); } else if (data.Result != "") { alert(data.Result); location.reload(); } else if (data.Status == "1") { $(window.location).attr("href", CommonURL + "Dashboard/CandidateResult"); $("#txtRegistrationNo").val(""); $("#txtDateOfBirth").val(""); $("#txtCaptcha").val(""); } else { location.reload(); } UnBlockUI(); }).fail(function (error) { GetMsgBox("Error In CheckResult:" + error.responseText, "E"); $("#btnSubmit").prop('disabled', false); UnBlockUI(); }); } catch (e) { alert("Error In PrintApplicationForm: " + e.message); $("#btnSubmit").prop('disabled', false); UnBlockUI(); } } function ForgotRegistrationNo() { try { BlockUI(); $.post(CommonURL + "Dashboard/ForgotRegistrationNo", AddAntiForgeryToken({ EmailID: $("#txtEmailId").val(), }), function (data) { if (data.Result == "Expired") { SessionExpire(); } else if (data.Result != "") { alert(data.Result); $("#txtEmailId").val(""); } UnBlockUI(); }).fail(function (error) { GetMsgBox("Error In ForgotRegistrationNo:" + error.responseText, "E"); UnBlockUI(); }); } catch (e) { alert("Error In ForgotRegistrationNo: " + e.message); UnBlockUI(); } } function ClearData() { $("#txtRegistrationNo").val(""); $("#txtRegistrationNo").focus(); }