Этот код написан на validation.js для динамической проверки всех форм смены пароля laravel
$.validator.addMethod("matchp", function(value, element)
{
var dbpass = $("#old").val();
// #old value is fetch from database in type=hidden in frontend and its in bcrypt format.
var txtpass = bcrypt($("#oldpass").val());
// #oldpass value is fetch from frontend its user value and it sholud convert in bcrypt format.
// So that we can compare it to verify the old password while changing the old password.
// Check for equality with the password inputs
if (dbpass != txtpass ) {
return false;
} else {
return true;
}
}, "Your Passwords Must Match");
Подробнее здесь: https://stackoverflow.com/questions/446 ... javascript