[SOLVED] Matching password in .Net validate by JavaScript?


I have two textbox in Asp.Net: first for password and second is for a matching password.

How can I validate whether user entered different value in both textboxes through JavaScript at client side?


The simplest js for this would be

if(document.getElementById('password1').value != document.getElementById('password2').value){
    // they do not match

But if you are using .NET, you might want to take the advice to use a CompareValidator.

Answered By – Brian Moeskau

Answer Checked By – David Marino (BugsFixing Volunteer)

Leave a Reply

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