Html手记:表单标签

来源:互联网 发布:业务流程数据化的例子 编辑:程序博客网 时间:2024/06/16 08:35

1、表单标签及常用属性

<form name="login" id="login" action="Login.php" method="post" entype="text/plain"></form><!--属性说明-->name  :表单名称id    :表单唯一id,一般用于javascript使用action:表单提交到后台的urlmethod:表单提交的方式,常用有get和post两种方式entype:表单数据的编码,默认为application/x-www-form-urlencoded,文本编码为text/plain,二进制编码为multipart/form-data

2、表单input控件标签

<!--文本框--><input type="text" size="100" maxlenght="13" value="初始字符" /><!--密码框--><input type="password" /><!--按钮--><input type="button" value="按钮1" /><!--单选按钮--><input name="rd" type="radio" value="1" checked="checked" /><input name="rd" type="radio" value="2" /><input name="rd" type="radio" value="3" /><!--复选框--><input name="ck" type="checkbox" value="1" checked="checked" /><input name="ck" type="checkbox" value="2" /><input name="ck" type="checkbox" value="3" /><!--重置按钮--><input type="reset" value="重置" /><!--提交按钮--><input type="submit" value="提交" /><!--图像按钮--><input type="image" src="/image/button.jpg" /><!--文件按钮--><input type="file" />

3、标签

<!--第一种内包含使用方式--><lable><input type="radio" value="1" />按下我就会选择单选按钮</lable><!--第二种绑定Id使用方式--><label for="rd">我会选择id为rd的标签</lable><input id="rd" type="radio" value="2" />

4、多行文本框

<textarea cols="3" rows="5" wrap="off"></textarea><!--属性说明-->cols:列的长度,一字宽为单位rows:行的高度,一字高为单位wrap:换行方式,off不自动换行,virtual自动换行带换行符,phisical自动换行不带换行符

5、普通按钮

<button type="button" value="按钮1"></button>

6、下拉列表

<!--只显示一行,提供下拉选择--><select name="sl" muliple="false" size="5">    <option value="中国" selected="selected">中国九州</option>    <option value="美国" >美国50州</option></select><!--显示多行提供选择--><select name="sl" muliple="true" size="10">    <option value="中国" selected="selected">中国九州</option>    <option value="美国" >美国50州</option></select>

7、表单控件分组

<fieldset>    <lenged>我这里写分组标题</lengend>    <input type="text" />    <input type="text" />    <input type="text" /></fieldset>
0 0
原创粉丝点击