Published on: 11/14/13 3:39 PM
Category:Code Tags: jqueryFor 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