Email: info@zenconix.com

Confirm Old Password and New Password at client side with jquery

Published on: 11/14/13 3:39 PM

Category:Code Tags:

For changing password module, we need to check whether entered password and new password are same or not for such case we can have 2 options 1) Check in database with the help of store procedure or any sql function  – but the problem with that is it will go to the server and ultimately take more time for execution 2) Check at client side only we can have jquery too , to check the same as follows

HTML

[sourcecode language=”csharp”]
<!– confirmat of the old passsword and new password–>
<input type="text" id="oldPassword" />
<input type="text" id="newPassword" />
<input type="Submit" id="btnSubmit" value="Submit" />
</span>
[/sourcecode]

Jquery function

[sourcecode language=”csharp”]
$("#newPassword").focusout(function ()
{
var val1 = $("#oldPassword").val();
var val2 = $("#newPassword").val();
if (val1 == val2) {
alert("old password and new password are same");
}
});
[/sourcecode]

for more, visit See Demo


Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

How Angular Application starts?

In this post we are going to take look on how angular application starts. For any angular application, entry point is index.html. In index.html file there is tag called as <app-root> In main.ts file <app-root> selector is picked up by the AppModule. Below is code snippet from main.ts file AppModule is module which is bootstrapped […]

Learn C# – Namespaces

What is Namespaces in C#? C# Programs are organized using namespaces. Namespaces are used to add separation of Code in C#. Namespaces can have following members inside it. Namespaces (nested) Classes Interface Delegates Structures Why to use Namespaces? Code Separation: With help of Namespaces, you can separate out set of code in C# Project.Example: if […]

Steps by step procedure to connect the database to Lumen

Create database in phpmyadmin Open .env file. NOTE: if .env file is with name, .env.sample, then rename it to .env Change following parameter in file DB_DATABASE=lumen DB_USERNAME=root DB_PASSWORD= Also check for following parameters if they are different than default setting DB_HOST=127.0.0.1 DB_PORT=3306 Next, as we are going to use Eloquent ORM, we need to un-comment […]