anuj_web
New Member
- Messages
- 145
- Reaction score
- 0
- Points
- 0
In my website i navigate a person from his profile to another page where he enters his old ,new password and retypes his new password..
I used a variable count to count the no of failed attempts...it is just not working...
I used a variable count to count the no of failed attempts...it is just not working...
Code:
function chngepwd()
{
if(count>3)
{
alert("Number of attempts allowed have been used.Please wait!!!");
window.onbeforeunload = function () {
return "This session is expired and the history altered.";
}
document.frmchgpwd.login.type="submit";
document.frmchgpwd.action="/Index.php";
document.frmchgpwd.submit();
}
var oldpass= document.frmchgpwd.txtoldpass.value ;
var newpass= document.frmchgpwd.txtnewpass.value ;
var rnewpass= document.frmchgpwd.txtrnewpass.value ;
var chkpass=document.frmchgpwd.txtchkpass.value ;
var count=0;
if(oldpass==chkpass)
{
if(newpass)
{
if(newpass==rnewpass)
{
document.frmchgpwd.txtchkpass.value=newpass ;
document.frmchgpwd.login.type="submit" ;
document.frmchgpwd.action="Update.php";
document.frmchgpwd.submit();
}
else
{
document.frmchgpwd.login.type="button" ;
alert("Passwords dont match !!!.Try again");
count=count+1;
}
}
}
else
{
document.frmchgpwd.login.type="button" ;
alert("Wrong password entered.Try again !!!");
count=count+1;
}
}