源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

Lesson02_03 表单标签

  • 时间:2022-07-09 14:56 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:Lesson02_03 表单标签
[h2]<form></form>[/h2]用来创建一个表单,即定义表单的开始和结束位置
属性名 作用
action 设置处理表单的服务器端URL地址.默认为表单页
method 用来设置将表单中的信息提交给服务端的处理程序时所用的方式   取值为:get或post 默认值为:get 传大于1K的时候要用post
target 用来指定服务器返回结果显示的目标窗口或目标帧
title 用来设置当网站访问者的鼠标在表彰会上的任一位置停留过几秒时显示的文字
enctype 指示浏览器使用哪种编码方法将表单数据传送给www服务器,其取值为: application/x-www-form-urlencoded和multipart/form-date,默认为前者
[h2]提交按钮:<input type="submit">[/h2]用于提交表单的内容 当设有name值时其name及value也要提交给服务器
代码如下: <form> <input type="submit"> </form> 效果如下:
[h2]重置按钮:<input type="reset">[/h2]用于将表单的内容置为默认值
代码如下: <form> <input type="reset"> </form> 效果如下:
[h2]单行文本输入区域:<input type="text">[/h2]其有一个size属性来指定输入区域的大小,以字符为单位
代码如下: <form> <input type="text"> </form> 效果如下:
size属性: <form> <input type="text" size="9"> </form> 效果如下:
maxlength属性下: <form> <input type="text" maxlength="10"> </form> 只可以输入9个字符 效果如下:
value属性: <form> <input type="text" value="Loncer"> </form> 效果如下:
readonly属性:[code] <form> <input type="text" readonly value="Loncer"> </form>[/code] 手工改动不了,可以用脚本去改 效果如下:
disable属性:[code] <form> <input type="text" disabled value="Loncer"> </form>[/code] 当不存在这个元素,不将其传给服务器 效果如下:
[h2]复选框按钮:<input type="checkbox">[/h2]
[code] <form> <input type="checkedbox" name=check> </form>[/code] 效果如下:
对不
checked属性[code] <form> <input type="checkedbox" checked name=check> </form>[/code] 效果如下:
对不
[h2]单选框按钮:<input type="radio">[/h2]只可以一个被选中
[code] <form> <input type="radio" name=radio1 value=1 checked>男 <input type="radio" name=radio1 value2>女 </form>[/code] 效果如下:
[h2]隐藏字段:<input type="hidden">[/h2]不显示,用于提交隐藏的信息 [h2]密码输入区:<input type="password">[/h2]使输入的内容为*号,即不可见的
代码如下: [code]<from>< input type="password"> </frome>[/code] 效果如下:
[h2]按钮:<input type="button">[/h2]与脚本相连
代码如下: <from>< input type="button" value="提交"> </frome> 效果如下:
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部