HTML 05: 表单(FORM)标记(TAGS)
2007-01-28 20:01
459 查看
表单(FORM)标记(TAGS)
基本语法
基本语法
表单的基本语法
<formaction="url"method=*>
...
...
<inputtype=submit><inputtype=reset>
</form>
*=GET,POST表单中提供给用户的输入形式
<inputtype=*name=**>
*=text,password,checkbox,radio,image,hidden,submit,reset**=SymbolicNameforCGIscript
文字输入和密码输入
*=text,password文字输入和密码输入
<inputtype=*>
<inputtype=*value=**>
<formaction=/cgi-bin/post-querymethod=POST>
您的姓名:
<inputtype=textname=姓名><br>
您的主页的网址:
<inputtype=textname=网址value=http://><br>
密码:
<inputtype=passwordname=密码><br>
<inputtype=submitvalue="发送"><inputtype=resetvalue="重设">
</form>
您的姓名:
您的主页的网址:
密码:
<inputtype=*size=**>
<inputtype=*maxlength=**>
<formaction=/cgi-bin/post-querymethod=POST>
<inputtype=textname=a01size=40><br>
<inputtype=textname=a02maxlength=5><br>
<inputtype=submit><inputtype=reset>
</form>
复选框(Checkbox)和单选框(RadioButton)
复选框(Checkbox)和单选框(RadioButton)
<inputtype=checkbox>
<inputtype=checkboxchecked>
<inputtype=checkboxvalue=**>
<formaction=/cgi-bin/post-querymethod=POST>
<inputtype=checkboxname=水果1>
Banana<p>
<inputtype=checkboxname=水果2checked>
Apple<p>
<inputtype=checkboxname=水果3value=橘子>
Orange<p>
<inputtype=submit><inputtype=reset>
</form>
Banana
Apple
Orange
<inputtype=radiovalue=**>
<inputtype=radiovalue=**checked>
<formaction=/cgi-bin/post-querymethod=POST>
<inputtype=radioname=水果>
Banana<p>
<inputtype=radioname=水果checked>
Apple<p>
<inputtype=radioname=水果value=橘子>
Orange<p>
<inputtype=submit><inputtype=reset>
</form>
Banana
Apple
Orange
图象坐标
在下面选则一个系数后,在图象上点一下,就知道什么是图象坐标了!图象坐标
<inputtype=imagesrc=url>
<formaction=/cgi-bin/post-querymethod=POST>
<inputtype=imagename=facesrc=f.gif><p>
<inputtype=radioname=zoomvalue=2checked>x2
<inputtype=radioname=zoomvalue=4>x4
<inputtype=radioname=zoomvalue=6>x6<p>
<inputtype=reset>
</form>
x2x4x6
隐藏表单的元素
隐藏表单的元素
<inputtype=hiddenvalue=*>
<formaction=/cgi-bin/post-querymethod=POST>
<inputtype=hiddenname=addvalue=hoge@hoge.jp>
Hereisahiddenelement.<p>
<inputtype=submit><inputtype=reset>
</form>
Hereisahiddenelement.
列表框(SelectableMenu)
列表框(SelectableMenu)
基本语法
<selectname=*>
<option>...
</select>
<optionselected>
<optionvalue=**>
<formaction=/cgi-bin/post-querymethod=POST>
<selectname=fruits>
<option>Banana
<optionselected>Apple
<optionvalue=My_Favorite>Orange
</select><p>
<inputtype=submit><inputtype=reset>
</form>
Banana
Apple
Orange
<selectsize=**>
<formaction=/cgi-bin/post-querymethod=POST>
<selectname=fruitssize=3>
<option>Banana
<optionselected>Apple
<optionvalue=My_Favorite>Orange
<option>Peach
</select><p>
<inputtype=submit><inputtype=reset>
</form>
Banana
Apple
Orange
Peach
<selectsize=**multiple>
注意,是用Ctrl键配合鼠标实现多选。(和MS-WINDOWS的FileManager一样)
<formaction=/cgi-bin/post-querymethod=POST>
<selectname=fruitssize=3multiple>
<optionselected>Banana
<optionselected>Apple
<optionvalue=My_Favorite>Orange
<optionselected>Peach
</select><p>
<inputtype=submit><inputtype=reset>
</form>
Banana
Apple
Orange
Peach
文本区域
文本区域
<textareaname=*rows=**cols=**>...<textarea>
<formaction=/cgi-bin/post-querymethod=POST>
<textareaname=commentrows=5cols=60>
</textarea>
<P>
<inputtype=submit><inputtype=reset>
</form>
对于很长的行是否进行换行的设置(WordWrapping)
<textareawrap=off>...</textarea>
不换行,是缺省设置。<textareawrap=soft>...</textarea>
“软换行”,好象MS-WORD里的“软回车”。<formaction=/cgi-bin/post-querymethod=POST><textareawrap=softname=commentrows=5cols=25></textarea><P>
<inputtype=submit><inputtype=reset>
</form>
<textareawrap=hard>...</textarea>
“硬换行”,好象MS-WORD里的“硬回车”。<formaction=/cgi-bin/post-querymethod=POST><textareawrap=hardname=commentrows=5cols=25></textarea><P>
<inputtype=submit><inputtype=reset>
</form>
相关文章推荐
- html教程(五) 表单(FORM)标记(TAGS)
- HTML--表单(FORM)标记(TAGS)
- HTML-表单(FORM)标记(TAGS)
- HTML基本语法五 表单(FORM)标记
- 表单(FORM)标记(TAGS)
- 表单(FORM)标记(TAGS)
- 关于html中表单<form>标记的介绍
- 表单(FORM)标记(TAGS)
- HTML标记之Form表单
- Html-4.结构标记和表单<form/>
- 表单(FORM)标记(TAGS)
- 表单(FORM)标记(TAGS)
- HTML表单标记教程(3):输入标记
- HTML的表单元素与Struts的FormBean关联实验(以Struts的helloapp为例)
- php 去除html标记--strip_tags与htmlspecialchars的区别详解
- form表单action提交的js部分与html部分
- 国人编写的、超牛的、基于jQuery插件式、监听模式(无侵入)的html页面form表单通用验证框架
- 了解HTML表单之form元素
- HTML-文字布局(TEXT STYLE)标记(TAGS)
- HTML5混编学习笔记: 表单(form)、响应式web设计(RWD)