Saturday, June 27, 2026

Java Script Test Box Blank

 <!DOCTYPE html>

<html>

<head>

    <title>Textbox Validation</title>

    <script>

        function validateTextBox() {

            var name = document.getElementById("txtName").value;


            if (name.trim() === "") {

                alert("Please enter your name.");

                return false;

            }


            alert("Submitted Successfully!");

            return true;

        }

    </script>

</head>

<body>


    <label>Name:</label>

    <input type="text" id="txtName">


    <br><br>


    <button onclick="validateTextBox()">Submit</button>


</body>

</html>

No comments:

Post a Comment

Cookies login

  Match login id and password using cookies under 1 minutes if user not input valid I'd pass in 1 min then cookies expired and go to hom...