对于表单的一些想法
表單
<form id="" name="" method="get/post" action=""> 其中g(shù)et提交長(zhǎng)度有限制,并且編碼后內(nèi)容在地址欄可見(jiàn),post與其相反。
</form>
?
文本輸入
文本框<input type="text" id="" name="" value=""/ placeholder是文字變灰>
密碼框<input type="password" id="" name="" value=""/>
文本域<textarea name="" id="" cols="字符多少" rows=“幾行” ></textarea>
?
按鈕
提交按鈕<input type="submit" name="" id="" value="" disabled=""/>
點(diǎn)擊后form內(nèi)提交服務(wù)器地址
重置按鈕<input type="resest" name="" id="" value=""/>
普通按鈕<input type="button" name="" id="" value=""/>
圖片按鈕<input type="image" name="" id="" value="" src="圖片地址"/>
其中disabled是按鈕失效的意思
?
單選與多選
單選
<input type="radio" id="" name="" value=""/>
<label for=""></label>
多選
<input type="checbox" id="" name="" value=""/>
<label for=""></label>
?
下拉列表
<select name="" id="" size="" multiple="multiple"> ? ? ?size大于1是列表,multiple是多選
<option value="">內(nèi)容</option>
<option value="" selected="slected">內(nèi)容</option> ? ?selected是設(shè)為默認(rèn)
</select>
?
文件上傳
<input type="file" name="" id=a''/>
具體以作業(yè)為例-------制作一張注冊(cè)表
 <body>
   <table width="300px" height="400px" border="1" background="PPS 2011-08-30 20'49''12.jpg" >
     <tr>
       <td>
         <form method="post" action="http://www.sina.com">
       <table border="1px">
     <tr>
       <td>登錄名:</td>
       <td>
         <input type="text" name="userid" value="" placeholder="登錄名" required="required">
       </td>
     </tr>
     <tr>
       <td>密碼:</td>
       <td>
         <input id="a" type="password" name="pwd" value="" required="required" placeholder="請(qǐng)輸入1~16位密碼">
       </td>
     </tr>
     <tr>
       <td>確認(rèn)密碼:</td>
       <td>
         <input id="b" type="password" name="pwd" value="" required="required" placeholder="請(qǐng)輸入1~16位密碼">
       </td>
    </tr>
     <tr>
       <td>手機(jī)號(hào):</td>
       <td>
         <input id="m" type="text" name="4" value="" placeholder="僅用于找回密碼">
       </td>
     </tr>
    
?    <tr>
       <td>性別:</td>
       <td>
         <input type="radio" name="r1" value="a" value="1"/>
           <label for="r1">男</label>
         <input type="radio" name="r1" value="a" value="2"/>
           <label for="r1">女</label>
       </td>
     </tr>
     <tr>
       <td>生日:</td>
       <td>
         <input type="text" name="shengri" value="" id="111111111" />
       </td>
     </tr>
     <tr>
       <td>民族:</td>
       <td>
         <select name="aihao" size="1">
           <option value="0">漢族</option>
           <option value="1">壯族</option>
           <option value="2">維吾爾族</option>
           <option value="3">滿族</option>
           <option value="4">高山族</option>
         </select>
       </td>
     </tr>
     <tr>
       <td>興趣愛(ài)好:</td>
       <td>
         <input type="checkbox" name="aihao" id="1" value="a"/>
           <label for="aihao">游泳</label> 
         <input type="checkbox" name="aihao2" id="2" value="b"/>
           <label for="aihao2">籃球</label>
         <input type="checkbox" name="aihao3" id="3" value="c"/>
           <label for="aihao3">跑步</label>
       </td>
     </tr>
     <tr>
       <td>心動(dòng)類型:</td>
       <td>
         <input type="checkbox" name="xindongleixing" value="" id="111" />
           <label for="xindongleixing">黑</label>
         <input type="checkbox" name="xindongleixing2" value="" id="222">
           <label for="xindongleixing2">長(zhǎng)</label>
       </td>
     </tr>
     <tr>
       <td>其他</td>
       <td height="50px">
         <textarea name="234" id="aaa" cols="30" rows="4" placeholder="此項(xiàng)可不填"></textarea>
       </td>
    </tr>
     <tr>
       <td colspan="2">
         <input type="image" name="q" id="mm" src="2016-11-22_digitalliteracy_home.jpg" width="295px" height="100px">
       </td>
     </tr>
     <tr>
       <td colspan="2">
         <input type="submit" name="111" id="olf">
         <input type="reset" name="111" id="we">
       </td>
     </tr>
</table>
</td>
</tr>
 </table>
 </form>
?</body>
?
轉(zhuǎn)載于:https://www.cnblogs.com/li1056822533/p/6212729.html
總結(jié)
 
                            
                        - 上一篇: 【BZOJ2073】[POI2004]P
- 下一篇: js中的this指针(二)
