Search

Monday, April 6, 2015
0 comments

Required validation in Java Script

6:07 AMMonday, April 6, 2015
<!DOCTYPE html>

<html>
<head>
    <title>encode and decode</title>
    <script type="text/javascript" >
        function validation() {
            var val = document.getElementById('in');
            if (val.value.length == 0) {
                alert("Required");

            }
        }
        
    </script>
</head>
<body>
<h1>Example of required field validation control</h1>
<input type="text" name="gt" value="" id="in" />
<button onclick="validation();">perform validation</button>
</body>
</html>

Code generate the following output

Required validation in Java Script
Protected by Copyscape Online Copyright Protection Software

0 comments :

Post a Comment

 
Toggle Footer
Top