-->

Monday, April 6, 2015

Compare validation using Java Script

Compare validation using Java Script

<!DOCTYPE html>
<html>
<head>
    <title>encode and decode</title>
    <script type="text/javascript" >
        function validation() {

            var firstvalue = document.getElementById('first');
             var secondvalue = document.getElementById('second');
             if (firstvalue.value != secondvalue.value) {
                alert("Password not match");

            }

        }
        
    </script>
</head>
<body>
<h1>Example of compare field validation control</h1>

Password<input type="password" name="gt" value="" id="first" /><br />
Re-type<input type="password" name="gt" value="" id="second" />
<button onclick="validation();">perform validation</button>

</body>
</html>

Code generate the following output

Compare validation in Java Script

Read other related articles

Also read other articles

© Copyright 2013 Computer Programming | All Right Reserved