问题描述:

I have created anchor tag and on click of that i just open simple popup which ask for email id to retrieve the password. Now when i click on forget password it show me forget link two times. Below is my code.

 <!-- login start --->

<div class="gu_login">

<label id="errMsg"></label>

<p>Login</p>

<input name="username" type="text" id="username" placeholder="USERNAME" />

<input name="password" type="password" id="password" placeholder="PASSWORD" />

<input name="submit" type="submit" value="Log In" class="gu_btn" id="btnSubmit" onclick="return login();" />

<a href="#forgot_password" id="forgotPassword">Forgot Password?</a>

</div>

<div class="splash fade-in" id="splashScreenForgotPassword" style="display: none; align-self: center">

<label id="errMsgForgotPassword"></label>

<h1 class="splash-title fade-in">

Please Answer Security Question

</h1>

<div class="gu_manualformcont">

<div class="gu_manualform">

<label>Question</label><h1 class="floatleft martop5 width380 alignleft"><span id="securityQuestion"></span></h1></div>

<div class="gu_manualform">

<label>Answer</label>

<input type="password" id="securityAnswer" placeholder="ANSWER" class="width380 height50" />

</div>

<div class="gu_manualform">

<input type="button" id="BTNSave" value="Submit" onclick="VerifyAnswer();" class="btnlarge green-btn floatrightimp marleft5" />

<input type="button" value="Cancel" class="btnlarge red-btn floatrightimp marright5" onclick="$('#splashScreenForgotPassword').hide();" />

</div>

</div>

<a href="#" class="splash-close fade-in">

<img src="/library/images/down-arrow.png" alt="" /></a>

</div>

<!-- login end --->

Given is code for JQuery

$(document).ready(function () {

$("#username").focus();

$('a[href="#forgot_password"]').click(function () {

if ($("#username").val().length > 0) {

try {

var retVal = "";

$("#errMsg").text('');

$("#errMsg").removeClass("error");

var urlCreate = "login.aspx?method=ForgotPasswordSecurityQuestion&userName=" + String($("#username").val());

$.ajax({

type: "POST",

url: urlCreate,

contentType: "text/plain",

dataType: "",

success: function (response) {

//alert(response);

if (String(response).length >= 0) {

if (response.indexOf('not found') > 0) {

ShowError(response);

}

else {

var returnVal = response.split("|");

var re = new RegExp('_', 'g');

$('#securityQuestion').text((returnVal[1]).replace(re," ") + "?");

securityAnswer = returnVal[2];

userID = returnVal[0];

ShowSplashScreen("splashScreenForgotPassword");

}

}

else {

ShowError("error occurred while processing your request");

}

},

error: function (response) {

ShowError(response);

}

});

}

catch (err) {

alert("Catch" + err);

}

}

else {

ShowError("Please enter user name");

}

});

});

Given is Screenshot of IPad for the Error.

Error screenshot

相关阅读:
Top