Category: 

What Is an HTML Submit Button?

Article Details
  • Written By: Ray Hawk
  • Edited By: E. E. Hubbard
  • Last Modified Date: 09 April 2014
  • Copyright Protected:
    2003-2014
    Conjecture Corporation
  • Print this Article
Free Widgets for your Site/Blog
Fluorescent light bulbs use 80% less electricity and last as much as 12 times longer than conventional light bulbs.  more...

April 16 ,  1947 :  The term "Cold War" w  more...

A hypertext markup language (HTML) submit button is a type of computer code used for a website that displays a graphic image of a button, which, once clicked on with a mouse cursor, results in the execution of a predefined command. Usually, an HTML submit button is included at the bottom of an online form, and, once the form is completely filled out by a visitor to the website and the button is "pressed," the code connected to the button executes a command that transmits the contents of the form to the website manager as a text or email file. The HTML submit button is one of the earliest and most fundamental graphically-controlled interactive features created for websites. Since it is a very early form of HTML code, it is widely recognized by almost all versions and types of Internet browsers and is a reliable method of carrying out website form actions on behalf of visitors to the site.

A typical line of HTML code for a website that controls a submit button would be written in the following format: <input type="text" name="FirstName" value="Submit" />

Ad

Each collection of words separated by a space within the "tags" or opening and closing less-than and greater-than signs performs a different function. The "input" element defines the action of the button as one that will accept user interactions, and the "type" for this element defines what can be entered in the form, such as text. The "name" value defines what is allowed in the form such as someone's name, which can further be defined by limiting factors such as "maxlength" which limit names entered to a certain number of characters. The "value" element of the code defines the action the button actually takes when it is clicked on by a mouse cursor, with "submit" resulting in the text entered in the form being sent to the website manager's account.

Writing HTML is fairly simple for basic commands, as there are often several different ways to perform a command that are valid. The HTML submit button is an example of this, where some flexibility is offered for those new to working with HTML. The submit features for the button can be entered on separate lines within the <form> value of the HTML code, to more clearly define what they do. For example, on one line of code the action or "input" value of the form can be defined as <form action="post.asp" method="post"> where the data is submitted as an active server page (asp), which is an enhanced version of HTML. The following two lines of code would have <input type="text" name="FirstName"> and <input type="submit"> to clearly separate each action that the HTML submit button takes when it is activated.

Website design also allows for other actions aside from the standard "submit" action when the HTML submit button is clicked on. These include setting the input type="reset" so that, when the button is pressed, all of the data in the form is cleared out. Also, an input type="button" line of code will allow the button to actually show a visual presentation of the submit button being pressed down when clicked on by the mouse cursor, like a button in real life would show. Since "button" is not a recognized part of standard form processor code, however, an HTML editor typically links this command to additional JavaScript code so that other operations can be performed when it is activated.

Ad

Discuss this Article

Post your comments

Post Anonymously

Login

username
password
forgot password?

Register

username
password
confirm
email