Required validation in Java Script

April 06, 2015 0 Comments

<!DOCTYPE html>

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

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

Code generate the following output

Required validation in Java Script

Jacob Lefore

Some say he’s half man half fish, others say he’s more of a seventy/thirty split. Either way he’s a fishy bastard. Google