第007讲 表单及各种表单控件2
2016-11-21 18:42
225 查看
隐藏域:不希望影响界面效果。但又希望提交数据
各种类型标签以及隐藏域
在这里有个问题:
如上代码如果直接点击提交 submit 的话看链接
file:///D:/Editplus/othershow/loginsuccess.html?citys=on&sex=on&data=ok&git=%E6%8F%90%E4%BA%A4
会发现城市后边 包括sex 后边 都等于 on 但是data这个隐藏域为什么不等于on呢,观察会发现 哦 原来是因为 citys和sex我们并没有value赋值这样就造成了这个问题
那么我们试试加上value
结果如下:
file:///D:/Editplus/othershow/loginsuccess.html?citys=beijing&sex=nan&data=ok&git=%E6%8F%90%E4%BA%A4
那那那 有值了吧
最后还有个img按钮类型 照常理 src拿到图片地址就好
各种类型标签以及隐藏域
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="Generator" content="EditPlus®"> <meta name="Author" content=""> <meta name="Keywords" content=""> <meta name="Description" content=""> <title>表单元素</title> </head> <body> <form action="?" method="GET"> 您最喜欢那些城市: <!-- 为了后边好统计数据建议name使用相同字段。why --> <input type="checkbox" name="citys"/>北京 <input type="checkbox" name="citys"/>上海 <input type="checkbox" name="citys"/>伦敦 <input type="checkbox" name="citys"/>华盛顿 <br/> 您的性别是: <input type="radio" name="sex"/>男 <input type="radio" name="sex"/>女 <br/> 隐藏域: <input type="hidden" name="data" value="ok"/> <input type="submit" name="git" value="提交"/> </form> </body> </html> 008
在这里有个问题:
如上代码如果直接点击提交 submit 的话看链接
file:///D:/Editplus/othershow/loginsuccess.html?citys=on&sex=on&data=ok&git=%E6%8F%90%E4%BA%A4
会发现城市后边 包括sex 后边 都等于 on 但是data这个隐藏域为什么不等于on呢,观察会发现 哦 原来是因为 citys和sex我们并没有value赋值这样就造成了这个问题
那么我们试试加上value
结果如下:
file:///D:/Editplus/othershow/loginsuccess.html?citys=beijing&sex=nan&data=ok&git=%E6%8F%90%E4%BA%A4
那那那 有值了吧
最后还有个img按钮类型 照常理 src拿到图片地址就好
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="Generator" content="EditPlus®"> <meta name="Author" content=""> <meta name="Keywords" content=""> <meta name="Description" content=""> <title>表单元素</title> </head> <body> <form action="loginsuccess.html" method="GET"> 您最喜欢那些城市: <!-- 为了后边好统计数据建议name使用相同字段。why --> <input type="checkbox" name="citys" value="beijing"/>北京 <input type="checkbox" name="citys" value="shanghai"/>上海 <input type="checkbox" name="citys" value="lundun"/>伦敦 <input type="checkbox" name="citys" value="huashengdun"/>华盛顿 <br/> 您的性别是: <input type="radio" name="sex" value="nan"/>男 <input type="radio" name="sex" value="woman"/>女 <br/> 隐藏域: <input type="hidden" name="data" value="ok"/> <input type="submit" name="git" value="提交"/> <input type="image" name="gitimage" src="go_home_and_shop.png"/> <!--图片也能做按钮--> </form> </body> </html>
select/option/textarea
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="Generator" content="EditPlus®"> <meta name="Author" content=""> <meta name="Keywords" content=""> <meta name="Description" content=""> <title>表单元素</title> </head> <body> <form action="loginsuccess.html" method="GET"> 您最喜欢那些城市: <!-- 为了后边好统计数据建议name使用相同字段。why --> <input type="checkbox" name="citys" value="beijing"/>北京 <input type="checkbox" name="citys" value="shagnhai"/>上海 <input type="checkbox" name="citys" value="lundun"/>伦敦 <input type="checkbox" name="citys" value="huashengdun"/>华盛顿 <br/> 您的性别是: <input type="radio" name="sex" value="nan"/>男 <input type="radio" name="sex" value="woman"/>女 <br/> <!-- size 表示展示出几个 multiple 表示可以多选 --> <select name="address" size=2 multiple> <option value="sichuan">四川</option> <option value="tianjin">天津</option> <option value="shanghai">上海</option> <option value="beijing">北京</option> <select/> <br/> <!-- 文本域 加上name之后 点击确定可以带上文本域内容 --> <textarea cols="20" rows="10" name="comment"> </textarea> <br/> <input type="file" name="myfile"/>上传文件 <br/> 隐藏域: <input type="hidden" name="data" value="ok"/> <input type="submit" name="git" value="提交"/> <input type="image" name="gitimage" src="go_home_and_shop.png"/> </form> </body> </html>
相关文章推荐
- html表单的各种输入控件
- 表单标签,已经常用的各种控件总结
- 表单标签,已经常用的各种控件总结
- Vue2 指令v-on v-model 各种表单控件
- SNF快速开发平台MVC-各种级联绑定方式,演示样例程序(包含表单和表格控件)
- [网上搜集]c# WinForm开发 DataGridView控件的各种操作总结(单元格操作,属性设置)
- 将各种控件设置成圆形
- Appium基于安卓的各种FindElement的控件定位方法实践和建议
- 制作自定义WmlListAdapter来实现Mobile.List控件的各种效果
- 自定义表单-控件的想象
- 各种流行的界面换肤控件库比较
- Vue.js学习 Item9 – 表单控件绑定
- pagecontrol控件的各种使用方法
- QuickPager asp.net 分页控件、表单控件等自定义控件下载 和介绍 【2009.09.07更新】
- select表单控件的修饰代码
- 常用的表单控件的数据获取方式
- 第 4 章 祝福吧!把表单和输入控件都改成ext的样式
- 常用网站后台与前台表单的有效性复杂验证(net+jqury+ajax)不用验证控件方法
- 常用网站后台与前台表单的有效性简单验证(不用验证控件,怕忘)
- 韩顺平PHP学习视频笔记整理007表单及表单控件②