HTML Form表模块素全面掌握

以下所示:

XML/HTML Code拷贝內容到剪贴板
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
  2.   
  3. <html xmlns="http://www.w3.org/1999/xhtml">  
  4. <head>  
  5.     <title>申请注册表单</title>  
  6. </head>  
  7. <body>  
  8.     <form action="DoFormAction.htm">  
  9.         <fieldset style="width=800px">                                                              <!--套住申请注册报表的边框-->  
  10.         <legend>请键入以下的信息内容随后开展申请注册</legend>  
  11.         <table cellspacing="0px" cellpadding="6px" border="1px" bordercolor="black" align="center" width="600px">  
  12.             <tr>  
  13.                 <td align="right">客户名:</td>                                   <!--文字框-->  
  14.                 <td><input type="text" size="20" style="width:150px" /></td>  
  15.             </tr>  
  16.             <tr>  
  17.                 <td align="right">登陆密码:</td>                                     <!--登陆密码框-->  
  18.                 <td><input type="password" size="20" style="width:150px" /></td>  
  19.             </tr>  
  20.             <tr>  
  21.                 <td align="right">确定登陆密码:</td>  
  22.                 <td><input type="password" size="20" style="width:150px" /></td>  
  23.             </tr>  
  24.             <tr>  
  25.                 <td align="right">性別:</td>                                      <!--单选框-->  
  26.                 <td>  
  27.                     <input type="radio" checked="checked" name="sex1" value="男" />男    
  28.                     <input type="radio" name="sex1" value="女" />女   
  29.                 </td>  
  30.             </tr>  
  31.             <tr>  
  32.                 <td align="right">性別(能够点文本挑选):</td>  
  33.                 <td>  
  34.                     <fieldset style="width:150px">                              <!--表单外框,还可以根据css设定宽度-->  
  35.                     <legend>请挑选性別</legend>  
  36.                         <input type="radio" checked="checked" name="sex2" value="男" id="man" />  
  37.                         <label for="man"></label>  
  38.                         <input type="radio" name="sex2" value="女" id="woman" />  
  39.                         <label for="woman"></label>  
  40.                     </fieldset>  
  41.                 </td>  
  42.             </tr>  
  43.             <tr>  
  44.                 <td align="right">大城市:</td>                                    <!--往下拉框-->  
  45.                 <td>  
  46.                     <select name="city">  
  47.                         <option value="北京">北京</option>  
  48.                         <option value="深圳市">深圳市</option>  
  49.                         <option value="上海市">上海市</option>  
  50.                         <option value="南昌" selected="selected">南昌</option>  <!--默认设置挑选南昌-->  
  51.                     </select>  
  52.                 </td>  
  53.             </tr>  
  54.             <tr>  
  55.                 <td align="right">大城市所属地区:</td>  
  56.                 <td>  
  57.                     <select name="area">            
  58.                         <optgroup label="北京">                                <!--往下拉框排序显示信息-->  
  59.                             <option value="朝阳区区">朝阳区区</option>  
  60.                             <option value="海淀区">海淀区</option>  
  61.                             <option value="别的区">别的区</option>  
  62.                         </optgroup>  
  63.                         <optgroup label="南昌">  
  64.                             <option value="东湖区">东湖区</option>  
  65.                             <option value="杭州西湖区">杭州西湖区</option>  
  66.                             <option value="青山绿水湖区">青山绿水湖区</option>                               
  67.                         </optgroup>  
  68.                     </select>  
  69.                 </td>  
  70.             </tr>  
  71.             <tr>  
  72.                 <td align="right">交朋友总体目标:</td>  
  73.                 <td>  
  74.                     <select name="target" size="3" multiple="multiple">        <!--目录框-->         
  75.                         <option value="同行业" selected="selected">同行业</option>  
  76.                         <option value="一般盆友">一般盆友</option>  
  77.                         <option value="恋人">恋人</option>  
  78.                     </select>  
  79.                 </td>  
  80.             </tr>  
  81.             <tr>  
  82.                 <td align="right">喜好:</td>  
  83.                 <td>  
  84.                                                                             <!--复选框,留意name特性设定1样,排序-->      
  85.                     <input type="checkbox" name="love" value="足球" />足球   
  86.                     <input type="checkbox" name="love" value="蓝球" />蓝球   
  87.                     <input type="checkbox" name="love" value="乒乓球球" />乒乓球球   
  88.                 </td>  
  89.             </tr>  
  90.             <tr>  
  91.                 <td align="right">相片提交:</td>  
  92.                 <td>  
  93.                                                                             <!--文档挑选框-->      
  94.                     <input type="file" name="myPic" />  
  95.                 </td>  
  96.             </tr>  
  97.             <tr>  
  98.                 <td align="right">自身详细介绍:</td>  
  99.                 <td>  
  100.                                                                             <!--多写作本框-->      
  101.                     <textarea rows="5" cols="50">  
  102.                     </textarea>  
  103.                 </td>  
  104.             </tr>  
  105.             <tr>  
  106.                 <td align="center" colspan="2">  
  107.                     <input type="submit" value="明确" />  
  108.                     <input type="reset" value="清空" />                       
  109.                     <input type="image" src="../images/btnreg.png" onclick="alert('hello')" />      <!--演试照片按钮(会递交数据信息,相近submit)  
  110.                                                                                                     -->  
  111.                 </td>  
  112.             </tr>  
  113.         </table>  
  114.         </fieldset>  
  115.     </form>  
  116. </body>  
  117. </html>  

以上便是网编为大伙儿带来的HTML Form表模块素全面掌握的所有內容了,期待对大伙儿有一定的协助,多多适用脚本制作之家~