0% found this document useful (0 votes)
4 views6 pages

Change Password Form Validation Script

The document contains a JavaScript function for validating a password change form, ensuring that the old password, new password, and confirmation password are filled out correctly. It checks for empty fields and confirms that the new password and confirmation password match before submission. Additionally, it includes a form for users to input their passwords and submit the change request.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views6 pages

Change Password Form Validation Script

The document contains a JavaScript function for validating a password change form, ensuring that the old password, new password, and confirmation password are filled out correctly. It checks for empty fields and confirms that the new password and confirmation password match before submission. Additionally, it includes a form for users to input their passwords and submit the change request.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

<%@ include file="includes/header.

jsp" %>

<script>

function isValid(frm_obj)

if(frm_obj.old_password.value == "")

frm_obj.old_password.focus();

alert("Please enter the old password.")

return false;

if(frm_obj.new_password.value == "")

frm_obj.new_password.focus();

alert("Please enter the new password.")


return false;

if(frm_obj.confirm_password.value== "")

frm_obj.confirm_password.focus();

alert("Please enter the confirm password.")

return false;

if(frm_obj.confirm_password.value != frm_obj.new_password.value)

frm_obj.new_password.focus();

alert("New Password and confirm password doesnot match.")

return false;
}

return true;

</script>

<div class="wrapper row3">

<div class="rounded">

<main class="container clear">

<!-- main body>

<div id="comments" style="width:50%; margin:auto">

<h2>Change Password Form</h2>

<% if([Link]("msg") != null) { %>


<div class="msg"><%=[Link]("msg") %></div>

<%)%>

<form action="model/[Link]?act=change_password" method="post" onsubmit="return

isValid(this)">

<div>

<label for="name">Old Password <span>*</span></label>

<input type="password" name="old_password" id="old_password" value="" size="22">

</div>

<div>

<label for="email">New Password <span>*</span></label>

<input type="password" name="new_password" id="new_password" value="" size="22">

</div>
<div>

<label for="email">Confirm Password <span>*</span></label>

<input type="password" name="confirm_password" id="confirm_password" value="" size="22">

</div>

<div>

<input name="submit" type="submit" value="Reset Password">

&nbsp;

<input name="reset" type="reset" value="Cancel">

<input type="hidden" name="login_id" value="<%= [Link]("login_id") %>">

</div>

</form>

</div>

<div class="clear"></div>
</main>

</div>

</div>

<%@ include file="includes/[Link]" %>

You might also like