Solution <script> $(document).ready(function () { $('#Password, #CPassword').on('change', function () { var ps = $("#Password").val(); var cps = $("#CPassword").val(); if (ps != null && ps != '' && cps != null && cps != '') { if (ps != cps) { alert("Please Enter the same Password in both fields"); $('#Password').css('border-color', 'red'); $('#CPassword').css('border-color', 'red'); } else {... Continue Reading →