Printer Friendly Version

BellaOnline's HTML Editor

The HTML Form Submit and Reset Buttons – The Input Tag

A web form isn’t very useful to anyone without a submit button. In fact, without this button, your web form will just sit there on your webpage and cannot send the information it has collected to the processing program.

You will use the input tag to create a submit button. You can also use the input tag to create a reset button (which when clicked will reset all the input fields to their defaults).

<input type="submit" value="Send">

<input type="reset" value="Reset">
<left angle bracket
inputelement name
typeThe type attribute will control the type of button on the web form.
valueThe value attribute will display a label on the button.
>right angle bracket

As you can see, there are two attributes that control the web button. Also there is no closing input tag.

The Type Attribute
The type attribute tells the web browser to display a button within the form on the webpage. It will be the default gray, slightly 3D button. In the example, the first input tag tells the browser to display the submit button and the second input tag displays the reset button. When clicked these two buttons behave differently. The submit button will send the data to the CGI program and the reset button will clear the form back to its default condition.

The Value Attribute
The value attribute tells the web browser what text to display on the top of the button. Whatever is between the quotation marks on the right side of the equal sign will be displayed. In the example, the first input tag sets the label on the button to "Send" and the second input tag sets the label of the other button to "Reset".

This site needs an editor - click to learn more!

HTML Site @ BellaOnline
View This Article in Regular Layout

Content copyright © 2013 by Diane Cipollo. All rights reserved.
This content was written by Diane Cipollo. If you wish to use this content in any manner, you need written permission. Contact Editor Wanted for details.

| About BellaOnline | Privacy Policy | Advertising | Become an Editor |
Website copyright © 2016 Minerva WebWorks LLC. All rights reserved.

BellaOnline Editor