html知識——表單

來源:互聯網
上載者:User

標籤:

1.表單標記:<form>內容</form>

    屬性:     name(表單名稱)

          method(傳送資料方式):

            get--將表單的內容附加在URL地址的後面,所以限制了提交的內容的長度,不超過8192個字元,且不具備保密性

            post--將表單中的資料一併包含在表單主體中,一起傳送到伺服器中處理,沒有資料大小限制

          action:表單資料的處理常式的URL地址,如果為空白則使用當前文檔的URL地址,

              如果表單中不需要使用action屬性也要指定其屬性為“no”       

          enctype:設定表單資料的編碼方式

          target:和超連結類似,用來指定目標視窗

2.文本域和密碼:<input>標記 單標記

    屬性: type:text(文本輸入框)、password(密碼輸入欄位)

        name:名稱

        value:初始化值

        maxlenght:最大允許輸入的字元數

3.提交、重設、普通按鈕

    提交 <input type="submit"> 

    重設 <input type="reset">

    普通 <input type="button">

4.單選框和複選框

    單選 <input type="radio">

    複選 <input type="checkbox">

5.隱藏欄位

     <input type="hidden">

6.多行文本域<textarea>

    rows和cols屬性用來指定顯示的行數和列數

7.菜單下拉式清單域<select>

    格式:   

<select>  <option value ="volvo">Volvo</option>  <option value ="saab">Saab</option>  <option value="opel">Opel</option>  <option value="audi">Audi</option></select>

     <option>標籤:value(給選項賦值)

           selected(預設選項)

    

 

html知識——表單

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.