Hi, I have a popup window uses for password recovery. Two field are in the pop up window. User id and email text boxes. I want to display password inside a label box if both values are true. here is my code it isnt complete please help me I am stuck here
<a class="popup-trigger">Forgot Password</a>
<!--<div class="cta"><a href="#">Forgot your password?</a></div>-->
</div>
</div>
<div class="popup" id="model">
<input id="txt_password_userid" type="text" placeholder="Enter Your User ID..." style="background-color:#d7d6d6;" /><br /><br />
<input id="txt_password_email" type="text" placeholder="Enter Your Email ID..." style="background-color:#d7d6d6;" /><br /><br />
<input id="btn_password_submit" type="submit" value="Submit" style="background-color:#84C639" onclick="recoverypass(); return false" />
<span class="popup-btn-close" >close</span>
</div>
<!--forgot password-->
<script type="text/javascript">
function recoverypass() {
var usrid = document.getElementById("txt_password_userid").value;
var email = document.getElementById("txt_password_email").value;
if (usrid == '') {
alert("please enter your 6 digit userid");
return false
}
if (email == '') {
alert("Please enter email id");
}
var msg = "";
if (msg.length == 0) {
$.ajax({
type: "POST",
dataType: "json",
contentType: "application/json; charset=utf-8",
url: "code.aspx/password",
data: "{'pusrid':'" + usrid + "','pemail':'"+email+"'}",
success: function (response) {
if (response.d == true) {
$("#txt_password_userid").val("");
$("#txt_password_email").val("");
}
else {
$('#dvResult').text("Please enter valid details");
alert("error");
}
$('#dvResult').fadeOut(6000);
},
error: function (xhr, textstatus, error) {
alert("Error: " + error);
$('#dvResult').text("Error: " + error);
}
});
}
else {
$('#dvResult').html(msg);
}
$('#dvResult').fadeIn();
}
</script>
<!--forgot password-->
<!--popup style-->
<style>
.popup-trigger { display: block; margin: 0 auto; padding: 20px; max-width: 260px; background: #84C639; color: #fff; font-size: 18px; font-weight: 700; text-align: center; text-transform: uppercase; line-height: 24px; cursor: pointer; }
.popup {display: none; position: absolute; top: 100px; left: 50%; width: 700px; margin-left: -350px; padding: 50px 30px; background: #fff; color: #333; font-size: 19px; line-height: 30px; border: 10px solid #145790; z-index: 9999;}
.popup-mobile {position: relative; top: 0; left: 0; margin: 30px 0 0; width: 100%;}
.popup-btn-close {position: absolute; top: 8px; right: 14px; color: #4EBD79; font-size: 14px; font-weight: bold; text-transform: uppercase; cursor: pointer;}
</style>
<!--popup style-->
<!--popup script-->
<script>
// Popup Window
var scrollTop = '';
var newHeight = '100';
$(window).bind('scroll', function() {
scrollTop = $( window ).scrollTop();
newHeight = scrollTop + 100;
});
$('.popup-trigger').click(function(e) {
e.stopPropagation();
if(jQuery(window).width() < 767) {
$(this).after( $( ".popup" ) );
$('.popup').show().addClass('popup-mobile').css('top', 0);
$('html, body').animate({
scrollTop: $('.popup').offset().top
}, 500);
} else {
$('.popup').removeClass('popup-mobile').css('top', newHeight).toggle();
};
});
$('html').click(function() {
$('.popup').show();
});
$('.popup-btn-close').click(function(e){
$('.popup').hide();
});
$('.popup').click(function(e){
e.stopPropagation();
});
</script>
<!--popup script-->
[WebMethod]
public static bool password(string pusrid, string pemail)
{
string status = "INSERT";
bool msg = false;
string constr = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
using (SqlConnection con = new SqlConnection(constr))
{
con.Open();
SqlCommand cmd = new SqlCommand("p_password", con);
cmd.CommandType = CommandType.StoredProcedure;
if (status == "INSERT")
{
cmd.Parameters.AddWithValue("@status", "INSERT");
cmd.Parameters.AddWithValue("@userid", pusrid);
cmd.Parameters.AddWithValue("@email", pemail);
}
cmd.ExecuteNonQuery();
msg = true;
}
return msg;
}