1. Im working on a login module at "forgot password" link.
2. A small window is opened when user clicks"forgot password" link.
3. User need to enter id,email address and the captcha characters appeared before user clicks the "Submit" button.
4. Temporary password is sent to the email if the user entered CORRECT id,email and captcha.
5. Red error message ("Wrong validation code) is appeared below the captcha textfield when the user entered wrong characters in that textfield and the "Submit" button is clicked. *no submission happen here (succeed)
6. I have done all this successfully.
7. Case: I fill in wrong captcha characters and click "Submit", red "Wrong validation code" message is appeared. I click "Close" button of the "forgot password" window and open back the "forgot password" window. I enter wrong captcha characters again and click "Submit". No submission happen here BUT there is no red "Wrong validation code" error message is appeared !!
8. Prob: red error message for wrong captcha characters entered only appear at the first time/ first load user use the "forgot password" window.
9. Ques:How to make the error message "Wrong validation code" appear for the second time and not only for the first time when the user enter wrong captcha characters.. Thank you.. note: no error in the log (console)
-----------------------------------------Two (.jsp) files codes involved(impt part of codes)-----------------
ForgotPassword.jsp file code :
$('#btnSubmitInfo2').button().click(function() {
if ($('#forgotForm').valid()) {
if ($('#verificationCode1').val() == $('#codeCaptcha').val()) {
var param = { loginId: $('#txtUserId').val(), email: $('#txtEmail').val() };
$('#forgotForm').attr("action",blesscontextpath+"/action/registration?forgotPassword");
$('#forgotForm').submit();
} else {
$('#messageCode2').replaceWith('<p id="messageCode" class="message"><font color="red">Wrong validation code</font></p>');
}
}
return false;
});
___________________________________________________________________________________
login.jsp file code:
$("#dialogForgot").dialog({
autoOpen: false,
height: 'auto',
width: 'auto',
modal: true,
title:'Forgot Password',
buttons: {
'Close': function() {
$('label.error').remove();
$('.required').removeClass('error');
$('.message').remove();
$('.field').val('');
$(this).dialog('close');
}
},
open: function() {
var temp = bless.randomString(4);
$('.fontCaptcha').text(temp);
$('#codeCaptcha').val(temp);
}
});

New Topic/Question
Reply


MultiQuote




|