HTML and CSS Reference
In-Depth Information
application/x-www-form-urlencoded (the default value when not specified),
multipart/formdata , and text/plain .
formmethod This HTML5 attribute indicates how form information should be transferred
to the server using a particular HTTP method. A get value in the attribute indicates that
form data should be appended to the URL specified by the action attribute creating a
query string. This approach is quite simple but imposes a size limitation that is difficult to
gauge (may be as low as 2 kilobytes or even ~300 characters in real situations). A value of
post for this attribute transfers the data of the form in the message body using the HTTP
POST method, which imposes no data size limitation. Browsers may allow for other HTTP
methods like delete or put , as suggested by the HTML5 specification, but so far such
usage is rare. The post value must be used when file attachments are used in a form.
formnovalidate This HTML5 Boolean attribute is used to indicate a form should not be
validated during submission. It is false by default but may be controlled either on the
button directly or on a containing or related form. Initially this was simply known as
novalidate .
formtarget This HTML5 attribute is set to the name of a window or frame that the button
action will target the result of action, similar to the target attribute on <a> and <form>
tags. Initially, this attribute was simply target in early drafts of HTML5.
name This attribute is used to define a name for the button so that it can be scripted by
older browsers or used to provide a name for submit buttons when a page has more than
one. The id attribute is preferred for scripting purposes.
type This attribute defines the action of the button. Possible values include button , reset ,
and submit , which are used to indicate that the button is a plain button, form reset button,
or form submission button, respectively. The XHTML specification indicates submit is the
default, but browsers may not enforce this in practice.
value
This attribute defines the value that is sent to the server when the button is clicked. This
might be useful when using multiple submit buttons that perform different actions, to
indicate to the handling server-side program which button was clicked.
Examples
<button name="Submit"
value="Submit"
type="Submit"> Submit Request </button>
<button type="button"
onclick="doSomething();"> Click This Button </button>
<button type="button">
<img src="polkadot.gif" alt="Polkadot"></button>
Compatibility
HTML 4, 4.01, 5
XHTML 1.0, 1.1
Firefox 1+, Internet Explorer 4+,
Netscape 6+, Opera 5+, Safari 1+
Search WWH ::




Custom Search