Как я называю поп див на функцию Success в AJAX
<div id="pwdModal" class="white-popup mfp-with-anim mfp-hide"> <div id="ForgotPassDiv"> <h3 class="text-center">Forgot / Change Password</h3> <div class="text-center"> <div class="panel-body"> <fieldset> <div class="form-group"> <input class="form-control input-lg" placeholder="E-mail Address" id="txtForgotPassEmail" name="email" type="email"/> </div> <input class="btn btn-lg btn-primary btn-block" value="Send My Password" id="btnForgotPass" type="submit"/> <lable>New password will be sent to your official Email-id</lable> </fieldset> </div> </div> </div> <div id="ChangePassDiv" style="display: none"> <h3 class="text-center">Change Password</h3> <div class="text-center"> <div class="panel-body"> <fieldset> <div class="form-group"> <input class="form-control input-lg" placeholder="Enter your 4 digit OTP" id="txtChangePassOTP" name="OTP" type="password"/> <input class="form-control input-lg" placeholder="Enter your new password" id="txtNewPass" name="NewPass" type="password"/> <input class="form-control input-lg" placeholder="Re-type your new password" id="txtConfirmPass" name="ConfirmPass" type="password"/> </div> <input class="btn btn-lg btn-primary btn-block" value="Done" id="btnChangePass" type="submit"/> </fieldset> </div> </div> </div> </div>
Это всплывающее окно для смены пароля ,
Я пытаюсь вызвать это всплывающее окно на ajaxSuccess funtion
$("#btnLogin").click(function () { debugger; var uName = $("#txtUserName").val(); var pass = $("#txtPassword").val(); var UserType= @Html.Raw(Json.Encode(ViewBag.Usertype)); if (uName == '' || pass == '') { alert("please enter required Fields.") } else { debugger; $.ajax({ type: "POST", url: "/MainIndex/ValidateUser", dataType: "json", data: { "userName": uName, "password": pass }, success: function (info) { if(info=="1") { var url = "/Latest/LatestReport"; window.location.href = url; } else if(info=="5") { var url = "/Latest/LatestReport"; window.location.href = url; } else if(info=="4") { var url = "/PrintedReport/PrintedReportMain"; window.location.href = url; } else if(info=="6") { // var url = "/Events/InnerConference"; var url = "/NewConference/iifl_conference"; window.location.href = url; } else if(info=="7") { var url = "/AboutUs/ResearchTeam"; window.location.href = url; } else if(info=="8") { var url = "/AboutUs/IIFLTeam"; window.location.href = url; } else if(info=="9") { var url = "/AboutUs/SalesTradingTeam"; window.location.href = url; } else if(info=="10") { var url = "/AboutUs/IBTeam"; window.location.href = url; } else if(info=="11") { var url = "/AboutUs/SettlementAndOp"; window.location.href = url; } else if(info=="12") { var url = "/AboutUs/Leadership"; window.location.href = url; } else { alert("Please Enter Valid Email ID And Password") $("#txtUserName").val(""); $("#txtPassword").val(""); } } }); } });
В этой функции я пытаюсь вызвать всплывающее окно div .. но это не вызов всплывающего окна.. Но непосредственно загрузка страницы
Что я уже пробовал:
$("#btnLogin").click(function () { debugger; var uName = $("#txtUserName").val(); var pass = $("#txtPassword").val(); var UserType= @Html.Raw(Json.Encode(ViewBag.Usertype)); if (uName == '' || pass == '') { alert("please enter required Fields.") } else { debugger; $.ajax({ type: "POST", url: "/MainIndex/ValidateUser", dataType: "json", data: { "userName": uName, "password": pass }, success: function (info) { // var model = @Html.Raw(Json.Encode(ViewBag.Usertype)); // // alert("Text is: " + model.Text); if(info=="1") { document.getElementById(" pwdModal").style.display; $("#pwdModal").show(); alert("Hello"); $("#pwdModal").removeClass("hide"); // ChangePassword(); // // var url = "/Latest/LatestReport"; // window.location.href = url; // var url = "/Events/InnerConference"; // window.location.href = url; } else if(info=="5") { var url = "/Latest/LatestReport"; window.location.href = url; } else if(info=="4") { var url = "/PrintedReport/PrintedReportMain"; window.location.href = url; } else if(info=="6") { // var url = "/Events/InnerConference"; var url = "/NewConference/iifl_conference"; window.location.href = url; } else if(info=="7") { var url = "/AboutUs/ResearchTeam"; window.location.href = url; } else if(info=="8") { var url = "/AboutUs/IIFLTeam"; window.location.href = url; } else if(info=="9") { var url = "/AboutUs/SalesTradingTeam"; window.location.href = url; } else if(info=="10") { var url = "/AboutUs/IBTeam"; window.location.href = url; } else if(info=="11") { var url = "/AboutUs/SettlementAndOp"; window.location.href = url; } else if(info=="12") { var url = "/AboutUs/Leadership"; window.location.href = url; } else { alert("Please Enter Valid Email ID And Password") $("#txtUserName").val(""); $("#txtPassword").val(""); } } }); } });
Он выполняет только условие info==1.. так как он был определен со стороны сервера
следовательно, внутри "info=1"
Я пытался это сделать
if(info=="1") { $("#pwdmodol").show(); } But the popup is not coming