input type="submit" Element


 

Module

The input type="submit" element is an inline element declared by the XHTML 1.1 Forms Module

Elements in the Forms Module are:
form | label | textarea | select | optgroup | option | button | fieldset | legend |
input type="button" | input type="checkbox" | input type="file" | input type="hidden" | input type="image" | input type="password" | input type="radio" | input type="reset" | input type="submit" | input type="text"

Description

The input type="submit" element creates a submit button for a form, with the button text being the contents of its value attribute (or some browser default text - e.g. "Submit" or "Submit Query" - if no value attribute is specified).

If a name attribute is specified on an input type="submit" element, a name=value pair is sent to the processing URI if that button is the one used to submit the form. No pair is sent if no name attribute is provided.

For example, the submit button below will send the pair button1=Continue to the processing URI if this button is used to submit the enclosing form.

<input type="submit" name="button1" value="Continue" />

This example button is contained below in a method="get" form. If you press it, you will reload this page with this pair appended to the URI as the query string ?button1=Continue just prior to the fragment identifier for this "Further Information" section (#details).

For other types of submit button see the input type="image" and button elements.

Padding Issues

In Internet Explorer, for reasons unknown, buttons with long text content are usually rendered with excessive horizontal padding - the longer the button text, the more excessive the padding. This annoyance can be avoided by using the CSS declarations width:auto; overflow:visible; and setting the padding property to the desired value.

#REQUIRED Attributes

Although the type attribute is not #REQUIRED on the input element, its default value is "text" and so must be present on input type="submit".


Specific Attributes

Specific attributes of the input type="submit" element are listed below:

From the Forms Module - the Element's own Module

accesskey [ type Character ]
Key to be pressed which allows the submit button to be activated directly from the keyboard
disabled [ type Boolean ]
If this attribute is present, the submit button is initially disabled - no data is sent to the processing URI for disabled elements when the form is submitted. The user cannot interact with a disabled control.
name [ type CDATA ]
This is the name sent to the processing URI for this submit button if it is the one activated to submit the form (if another submit button is activated - or if no name attribute is specified - no data will be sent for this button). The value sent (in a name=value pair) is that of its value attribute, if present, or else the default button text supplied by the browser (usually either "Submit", "Submit Query" or similar)
tabindex [ type Number ]
An integer between 0 and 32767 specifying the position of the submit button in the tabbing order of the document
value [ type CDATA ]
Specifies the text to be used as the button label, which will override the default value provided by the browser (usually either "Submit", "Submit Query" or similar). It is also the value which will be sent to the processing URI when the button is activated, provided that a name attribute has been specified.

From the Intrinsic Events Module

onblur [ type Script ]
Script to be executed when the element loses focus
onfocus [ type Script ]
Script to be executed when the element receives focus

Common Attributes

Common attributes of the input type="submit" element are listed below:

From the Core Attribute Collection

class [ type NMTOKENS ]
One or more space separated classes
id [ type ID ]
A unique identifier for the element
style [ type CDATA ], from the Style Attribute Module (deprecated)
Element-specific styles
title [ type Text ]
Descriptive title for the element (in some user agents this may appear as a "tooltip" when the mouse hovers over the element)
xmlns [ type URI - #FIXED 'http://www.w3.org/1999/xhtml' ]
XML namespace

From the I18N Attribute Collection

dir [ type Enumeration (ltr | rtl) ], from the Bi-directional Text Module
Left-to-right or right-to-left directionality
xml:lang [ type LanguageCode ]
A language code for the element

From the Events Attribute Collection

All attributes in the Events Attribute Collection are supported:
onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup


Content Model

The Content Model for the input type="submit" element is:

EMPTY

See Content Model & Nesting for information about Content Model syntax and Nesting Groups.

Valid children of input type="submit"

This element is empty and may have no children.

Valid parents of input type="submit"


Page Footer & Copyright

Copyright © Sally Maughan 2005-2009 (Page last updated on 01 Oct 2009)

*Valid XHTML 1.1 - hosted by *Openstrike

Content based on the W3C Working Draft: *XHTML 1.1 and Recommendation: *XHTML Modularisation 1.1.

W3C, XHTML, XML, HTML, CSS and MathML are *Trademarks of the W3C (*MIT, *ERCIM, *Keio) with which the site's author has no connection.


Up, Next & Previous Links

Your Location

Home > XHTML 1.1 Home > XHTML 1.1 Indexes > Element Index (XHTML 1.1) > input Elements > input type="submit"