Search

Monday, April 6, 2015
0 comments

Compare validation using Java Script

6:06 AMMonday, April 6, 2015
<!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
Protected by Copyscape Online Copyright Protection Software

0 comments :

Post a Comment

 
Toggle Footer
Top