天天看點

input标簽詳解,使用者系統資料庫單

input标簽的;

action; 把資料送出給伺服器的位址,若沒有就送出給自己

method ; 送出的方式(post , get )

type中可以指定的 number tel 來指定數字 電話号碼 或者使用date 來指定時間

  • 含有text <input type=“text” name="username" placeholder=“請輸入name” > name屬性會随送出(form)到其他頁面 就是作為參數
  • password
  • file (上傳檔案的)
  • radio (單選按鈕,比如選擇性别的時候 給起一個名字(名字相同的話)隻能單選

預設的是chacked ="checked"

  • checkbox 多選(方框) 複選按鈕

預設的是chacked ="checked" (可以寫多個預設勾選)

  • textarea 一個區域的文本框 設定 cols 和rows 來定框的大小

style =reset-non 不重新設定大小;

---------------------------------------------------------------------------------------------------------------------------------

  • select 标簽 下拉清單 請選擇 option 子标簽;

送出按鈕 <input type=“submit ” value=“送出,注冊”/>

重置按鈕<input type= "reset' value="重置">

普通按鈕<input type="botton" value="普通" >

botton 按鈕具有預設送出表單的功能,如果不指定type 就會送出表單

-------------------------------------------------------------------------------------------------------------------------------------------

  • form 表單标簽 送出的内容 包裹所需要送出的内容

action 屬性 要送出的位址 # 代表是本地位址

method get 方式(預設的送出方式,,把請求方式拼接在請求頁面,有大小的限制4KB)

post方式(把請求方式封裝在請求體中)

<form action="#" method="get" name="要送出參數的Key " ></form>

隻有存在name時候才能 接收資料

----------------------------------

必須要有name 才能夠送出;

若是單選或者複選框,必須提供value ,

<input type="hidden" name=" " value="隐藏域,主要儲存頁面的ID等資訊" />

-------------------------------------------------------------------------------------------------------------------------------------------

placeholder 是一種提示資訊

送出按鈕;

<input type="submmit" value =" 送出 ">

<input type ="image" src=" ... " value="" >

使用 lable 标簽來定義,查找;<lable></lable>

附代碼;

<!DOCTYPE html>
<html >
<head>
    <meta charset="UTF-8">
    <title>表單送出</title>
</head>
<body>
<!--隻有在form中定義name浏覽器才能夠送出資料 -->

<form action="#" method="get" name="getForm">
    <!-- 使用者名 <input type="text" name="username">
     密碼 <input type="password" name="password">
      <input type="submit" value="送出" >-->

    <!--單選框和複選框必須定義 name, value ,預設值checked -->
    <!--    性别; <input type="radio" name="gender" value="male">男
        <input type="radio" name="gender" value="female">女
        <br/>
        興趣愛好; <input type="checkbox" name="hobby" value="sw"> 遊泳
        <input type="checkbox" name="hobby" value="re"> 看書
        <input type="checkbox" name="hobby" value="tr"> 旅遊
        <input type="checkbox" name="hobby" value="sle"> 睡覺
        <br/>
        <input type="submit" value="送出啦">-->

    <!--   <select name="dd" id="findby">
           <option value="zhizhi">日本</option>
           <option value="zhizhi">美國</option>
           <option value="zhizhi">北韓</option>
           <option value="zhizhi">俄羅斯</option>
       </select>
       <input type="submit" value="送出">-->

    <!--input标簽中type=text,value預設的,placeholder是隐藏的文字  -->
    <!-- 請輸入賬戶;<input type="text" value="請輸入賬戶" name="zhanghu"><br/>
     請輸入密碼;<input type="password" placeholder="請輸入密碼" name="password">
     <input type="submit" value="送出按鈕">-->

    <!-- input标簽, 檔案上傳 type=file-->
    <!--  <input type="file">
      <input type="submit" value="送出">-->

    <!--input标簽中隐藏域,hidden-->
    <!--   <input type="hidden" name="這是隐藏域" value="這是隐藏域對應的值">
       <button value="送出">送出啊</button>&lt;!&ndash; button标簽預設有送出的功能&ndash;&gt;-->

    <!--文本域areatext标簽  指定style="resize:none" 使文本框不能被拉伸   ,圖檔按鈕typeimage -->
    自我介紹;<textarea name="jieshao" id="1" cols="30" rows="10" style="resize: none"></textarea>
    <br/>
    使用者名;<input type="text" name="username">
    <input type="image" src="../img/0x424410190743.jpg">
</form>
</body>
</html>
           

使用者系統資料庫單;

<!DOCTYPE html>
<html >
<head>
    <meta charset="UTF-8">
    <title>使用者注冊</title>
</head>
<body>
<form action="#" name="register" method="get">
<!--分析使用者注冊,表頭h 8行2列
使用者名 密碼 性别 愛好 學曆照片 個人簡介   其中lable标簽
-->
    <h2>使用者注冊</h2>
<table  width="500px">
    <tr>
        <td><lable for="username">使用者名</lable></td>
        <td><input type="text" name="username" id="username" placeholder="請輸入使用者名"></td>
    </tr>
    <tr>
        <td><lable>密碼</lable></td>
        <td><input type="password" name="password" placeholder="請輸入密碼"></td>
    </tr>
    <tr>
        <td><lable for="gender">性别</lable></td>
        <td>
            <input type="radio" name="gender" id="gender" value="male">男
            <input type="radio" name="gender"  value="female">女
            <input type="radio" name="gender"  value="null">妖
        </td>
    </tr>
    <tr>
        <td><lable>愛好</lable></td>
        <td>
            <input type="checkbox" name="hobby" value="sw">遊泳
            <input type="checkbox" name="hobby" value="ds">讀書
            <input type="checkbox" name="hobby" value="ly">旅遊
            <input type="checkbox" name="hobby" value="qj">拳擊
        </td>
    </tr>
    <tr>
        <td><lable>學曆照片</lable></td>
        <td><input type="file" name="username" placeholder="請輸入使用者名"></td>
    </tr>
    <tr>
        <td><lable>個人簡介</lable></td>
        <td><textarea name="jianjie" id="1" cols="30" rows="10"></textarea></td>
    </tr>
    <tr>
        <td colspan="2">
            <input type="submit" value="送出">
            <input type="reset" value="重置">
            <input type="button" value="點選">
        </td>
    </tr>
</table>

</form>
</body>
</html>
           
input标簽詳解,使用者系統資料庫單