Copy link to clipboard
Copied
This is Forgot Password Code
<!DOCTYPE html>
<html>
<head>
<title>Forgot Password</title>
<script>
function chkValues()
{
if(document.getElementById('emailid').value == '')
{
alert("Please enter emailid");
return false;
}
alert('hi, Password sent');
alert(document.getElementById('emailid').value);
return false;
}
</script>
</head>
<body>
<div class="Forgot password">
<div class="form">
<form class="forgot password">
<input type="text" placeholder="emailid" name="emailid" id="emailid" value=""/>
<br>
<button onClick="javascript:chkValues();">Login</button>
</form>
<a href ="Login.cfml"> Go Back to login</a>
</body>
</html>
This is my update password field
<cfif isDefined('form.updatepassword')>
<cfquery name="getPersonalInfo" datasource="myapp">
UPDATE PersonalInfo
SET password='#encrypt(form.confirmpassword,'AES')#'
WHERE username='#form.username#'
</cfquery>
<h1> Password Changed </h1>
<cfoutput> updation is successful </cfoutput>
</cfif>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Update Password</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script>
function myFunction()
{
var newpassword=document.getElementById("newpassword").value;
var confirmpassword =document.getElementById("confirmpassword").value;
if(newpassword==confirmpassword)
{
return true;
}
else
{
alert("Confirm password is not same as your new password.");
return false;
}
}
</script>
</head>
<body>
<form name="updatepassword" id="updatepassword" method="post" action="updatepassword.cfml">
<div class="updatepassword" style="display:;">
<tr>
<td>
New Password
</td>
<input type="text" placeholder="New Password" name="newpassword" id="newpassword" value="" pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}" title="Must contain at least one number and one uppercase and lowercase letter, and at least 8 or more characters">
</tr>
<tr>
<td>
Confirm Password
</td>
<input type="text" placeholder="confirm Password" name="confirmpassword" id="confirmpassword" value="">
</tr>
<br>
<input type="submit" name="updatepassword" value="updatepassword" onClick="javascript:return myFunction();"/>
<cfoutput>
<cfif isDefined('URL.username')>
<input type="hidden" name="username" id="username" value="#URL.username#">
<cfelseif isDefined('form.username')>
<input type="hidden" name="username" id="username" value="#form.username#">
</cfif>
</cfoutput>
</div>
</form>
</body>
</head>
</html>
Have something to add?