码迷,mamicode.com
首页 > 其他好文 > 详细

form表单

时间:2014-12-01 20:44:11      阅读:297      评论:0      收藏:0      [点我收藏+]

标签:blog   http   io   ar   color   os   使用   sp   for   

今天在云和学院学了form表单

html表单

?HTML表单是用于搜集用户输入的
?HTML表单都扩在一对form标签中
?<form>的常用属性
?action  表示提交的目标服务器
?method  提交的方法get、post
?get(默认,以url提交,就是以地址栏的方式提交)
?post(通过报文提交)
?文本框标签
?<input type = “text“ />
?密码框标签
?<input type = “password” />
?请输入密码:<input type="password" name="pwd" value="" /><br />
?文本域标签
?<textarea>内容</textarea>
?属性rows(行)和cols(列)
?<textarea>哈哈</textarea>
?提交按钮标签
?<input type=“submit” />
?<input type="submit" name="btn" value="提交" /><br />
?重设按钮标签
?<input type=“reset” />
?按钮标签
?<input type=“button” />
?<input type="button" value="按钮" onclick="alert(‘不要乱按‘)" />
?图像标签
?<input type=“image” />

复选框标签

?<input type=“checkbox” />
?<input type=“checkbox” name=“ch1” value=“chone” checked=”checked“  />文字
?单选按钮签
?<input type=“radio” />input type=“radio” name=“ra1” value=“raOne” checked=“checked“ />男(默认加checked=“checked”)
?文件选择标签
?<input type=“file” />
?<input type=“file” name=“f1” value=“fOne” />
bubuko.com,布布扣
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body>
    <form action="/" method="post">
        <label>用户名:</label><input type="text" name="txtUserName" value="" maxlength="7" /><br />
        <label>密码:</label><input type="password" name="txtUserPwd" value="" maxlength="16"/><br />
        <label>再次输入密码:</label><input type="password" name="txtUserPwd1" value="" maxlength="16" /><br />
        <label>性别:</label><input type="radio" name="txtGender" value=" " /><input type="image" src="男.png" /><label>男</label> 
        <input type="radio" name="txtGender" value=" " /><input type="image" src="女.png" /><label>女</label><br />
        <label>爱好:</label><input type="checkbox" name="txtRun" value=" " /><label>运动</label> 
        <input type="checkbox" name="txtTalk" value=" " /><label>聊天</label> 
        <input type="checkbox" name="txtPlayGame" value=" " /><label>玩游戏</label><br />
        <label>出生日期</label><input type="date" name="name" value=" " /><br />
        <label>国籍:</label><select>
            <option value="China">中国</option>
            <option value="Koren">韩国</option>
            <option value="Japan">日本</option>
        </select><br />
        <input type="reset" name="reset" value="重填" /> <input type="submit" name="name" value="同意一下服务条款,提交注册信息" /><br />
        <input type="button" name="btnPlayMusic" value="点播音乐" /> <input type="button"  name="btnqx" value="取消"/><br />
       
        <textarea rows="10" cols="30">
        本服务协议双方为淘宝与淘宝网用户,本服务协议具有合同效力。
        淘宝的权利与义务
        1.淘宝有义务在现有技术上维护整个网上交易平台的正常运行,并努力提升和改进技术,使淘宝用户网上交易活动的顺利。
        2.对用户在注册使用淘宝网上交易平台中所遇到的与交易或注册有关的问题及反映的情况,淘宝应及时作出回复。
        </textarea><br />
    </form>
</body>
</html>

bubuko.com,布布扣

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body>
<form action="/" method="post">
    <table >
        <tr><td>数字</td><td><input type="number" name="txtNumber" value=" " /></td></tr>
        <tr><td>范围</td><td><input type="range" name="txtrange" value=" " /></td></tr>
        <tr><td>颜色</td><td><input type="color" name="txtcolor" value=" " /></td></tr>
        <tr><td>电话号码</td><td><input type="tel" name="txttel" value=" " /></td></tr>
        <tr><td>日期</td><td><input type="date" name="txtdate" value=" " /></td></tr>
        <tr><td>月</td><td><input type="month" name="txtmonth" value=" " /></td></tr>
        <tr><td>周</td><td><input type="week" name="txtweek" value=" " /></td></tr>
        <tr><td>时间</td><td><input type="time" name="txttime" value=" " /></td></tr>
        <tr><td>隐藏</td><td><input type="hidden" name="txthidden" value=" " /></td></tr>
        <tr><td>url</td><td><input type="url" name="txtUrl" value=" " /></td></tr>
        <tr><td>搜索框</td><td><input type="search" name="txtsearch" value=" " /></td></tr>
       <tr><td colspan="2"><input type="file" name="f1" value=" " /></td></tr>
         <tr>
            <td colspan="2"><input type="submit" name="name" value="提交 " /></td>
        </tr>
    </table>
</form>
</body>
</html>

 

form表单

标签:blog   http   io   ar   color   os   使用   sp   for   

原文地址:http://www.cnblogs.com/songfang/p/4135812.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!