HTML form Tag
来源:互联网 发布:比维棠好的软件 编辑:程序博客网 时间:2024/05/16 01:19
HTML <form> Tag
Example
A simple HTML form with two input fields and one submit button:
<form action="form_action.asp" method="get">First name: <input type="text" name="fname" /><br />
Last name: <input type="text" name="lname" /><br />
<input type="submit" value="Submit" />
</form>
Try it yourself »
(more examples at the bottom of this page)
Definition and Usage
The <form> tag is used to create an HTML form for user input.
A form can contain input elements like text fields, checkboxes, radio-buttons, submit buttons and more. A form can also contain select menus, textarea, fieldset, legend, and label elements.
Forms are used to pass data to a server.
Browser Support
IE FireFox Opera Google Chrome SafariThe <form> tag is supported in all major browsers.
Differences Between HTML and XHTML
In XHTML, the name attribute of the <form> tag is deprecated, and will be removed. Use the id attribute instead.
Tips and Notes
Note: The form element is a block-level element, and creates a line break before and after itself.
Required Attributes
DTD indicates in which HTML 4.01/XHTML 1.0 DTD the attribute is allowed. S=Strict, T=Transitional, and F=Frameset.
Optional Attributes
multipart/form-data
text/plain Specifies how form-data should be encoded before sending it to a server STF method get
post Specifies how to send form-data STF name name Specifies the name for a form TF target _blank
_self
_parent
_top
framename Deprecated. Specifies where to open the action URL TF
Standard Attributes
The <form> tag supports the following standard attributes:
ltr Specifies the text directionfor the content in an element STF id id Specifies a unique id for an element STF lang language_code Specifies a language code for the content in an element STF style style_definition Specifies an inline style for an element STF title text Specifies extra information about an element STF xml:lang language_code Specifies a language code for the content in an element, in XHTML documents STF
More information about Standard Attributes.
Event Attributes
The <form> tag supports the following event attributes:
More information about Event Attributes.
- HTML form Tag
- The end tag "</html:form" is unbalanced
- end tag "</html:form" is unbalanced 错误分析
- 菜鸟学习中-end tag "</html:form" is unbalanced
- HTML Tag
- HTML tag
- html tag
- HTML TAG
- html tag
- HTML tag
- Form Tags ->Form Tag Themes
- 使用 jodd:form tag
- 使用 jodd:form tag
- Invalid location of tag (form)
- spring经验-form tag使用
- form/html
- html form
- Meta tag in html
- poj1511 spfa最短路+手写邻接表+反向建图
- cplv与mklvcopy的区别
- 打jar包
- Trubo C的命令行编译连接
- VC实现服务端和多客户端同步、超时处理实例
- HTML form Tag
- Super Flexible File Synchronize使用方法
- Interview
- ELF动态解析符号过程(修订版
- Robocup3D开发一年总结
- 算法设计与分析
- 湖北电信暑假实习
- 软件工程复习总结
- MTK IDLE 函数详解