Menu ▼

Previous Next

Submit :

Submit button will be used when user input need to be submit to server. For input tag we have to specify the type as "submit", then it will render a Submit button in output.

Syntax :

<input type="submit" />


Example :

<html>

<head>

    <title>HTML Tutorial</title>

    <script language="javascript">

        function checkcomments() {

            if (document.getElementById("txtComments").value == "") {

                alert("Please enter your comemnts.");

                return false;

            }

        }

    </script>

</head>

<body>

    <form action="submit.aspx">

    <div>

        Please post your comments :<br />

        <textarea id="txtComments" name="txtComments" rows="10" cols="50"></textarea>

        <br />

        <input type="submit" id="btnPost" value="Submit Post" onclick="return checkcomments();" />

    </div>

    </form>

</body>

</html>


Output :
HTML Tutorial
Please post your comments :

Previous Next




Search dotnetlearners.com