首页 > Web开发 > 详细

html-form表单

时间:2014-01-22 21:39:50      阅读:754      评论:0      收藏:0      [点我收藏+]

form use to collect user input and send user input to another file usually a jsp page 

in form body we can use control below to collect user input.

<form name="userInput" action="response.jsp" method="get">

输入控件

1. 输入的文本框  <input type="text" name="变量名"/>   

2. 输入密码框    <input type="password" name="password"/>

3. 单选框(互斥,只能选一个) <input type="radio" name="sex" value="male"/>

                                         <input type="radio" name="sex" value="femaile">

4. 多选框          <input type="checkbox" name="bike" value="bike"/>

                      <input type="checkbox" name="car"   value="car"/>

 

提交控件

<input type="submit" value="提交"/>

</form>

 

2. form  method属性

get:    默认是get,用户输入通过key-value方式 附在url上面,一次传输完成

post:  用户输入通过key-value 键对方式放在http报文body中,分段传输。使用firebug可以查看

 

bubuko.com,布布扣

 

 

 

使用post还是get

1. get适合短小的字段的表单,性能佳

2. post安全性佳,适合大数量字段和敏感数据的表单

 

3. response.jsp 通过 “param.控件name” 来获取输入值

html-form表单

原文:http://www.cnblogs.com/lzcrack/p/3529787.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!