HTML的表單form以及form內部標籤

來源:互聯網
上載者:User

<html> <head>  <title> form表單的使用 </title>  <!--  標籤名稱:form 表單標籤  屬性:action:提交的去向,目標地址的urlmethod:設定提交請求的方式,get和post;預設為getget和post提交有什麼區別?------------------------get傳輸:將內容資訊放在地址欄傳輸,而且長度限制在1k,而且安全性不好。post傳輸:將內容房子body資訊中傳輸。沒有長度限制。  子標籤:input標籤:需要提交其中的value,必須有一個name屬性。屬性:type:password 等//------------通過下面的執行個體的示範,發現在某些情況下可以用form去做連結,而且做連結的同時還能提交資料到這個目標的地址檔案上。fieldset標籤:定義域legend標籤:定義域的標題         --> </head> <body> <fieldset> <legend>form表單標籤,子標籤執行個體:</legend> <form action="01列表.html"  method="get">  <table  border="1px" width="800px">  <tr>列表標籤:<br><select name="cars"><option value="volvo">Volvo</option><option value="saab">Saab</option><option value="fiat" selected="selected">Fiat</option><option value="audi">Audi</option></select><br></tr><tr>複選框執行個體:<br>我喜歡單車:<input type="checkbox" name="Bike"><br>我喜歡汽車:<input type="checkbox" name="Car"><br></tr><tr>選項按鈕:<br>男性:<input type="radio" checked="checked" name="Sex" value="male"><br>女性:<input type="radio" name="Sex" value="female"></form><p>當使用者點擊一個選項按鈕時,該按鈕會變為選中狀態,其他所有按鈕會變為非選中狀態。</p></tr><tr>文本域:<br><textarea rows="10" cols="30">文本域標籤的使用</textarea></tr><tr></tr><tr></tr><tr><td>帳號:</td><td><input name="userid"></td></tr><tr><td>密碼:</td><td><input name="pwd"></td></tr><tr><td><input type="submit" value="確認提交"/></td><td><input type="reset" value="重設"/></td></tr>  </table>  </form>  </fieldset> </body></html>


只要是有name和value屬性的標籤都可以放在form內部,同時也可以將這些標籤的資料提交到另一個url。

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.