博客列表 >html表单初试

html表单初试

手机用户311660634
手机用户311660634原创
2022年10月19日 13:17:28325浏览

  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>表单初试</title>
  8. </head>
  9. <body>
  10. <form action="register.php" method="POST" enctype="multipart/form-data">
  11. <fieldset>
  12. <legend>用户注册信息</legend>
  13. <div class="username">
  14. <label for="uname">用户名:</label>
  15. <input type="text" id="uname" name="username" value="" placeholder="用户名只能是数字和字母" required>
  16. </div>
  17. <div class="password">
  18. <label for="upwd">密码:&nbsp; &nbsp;</label>
  19. <input type="password" id="upwd" name="passwoed" value="" placeholder="密码不少于六位" required>
  20. </div>
  21. <div class="email">
  22. <label for="uemail">邮箱:&nbsp; &nbsp;</label>
  23. <input type="email" id="uemail" name="email" value="" placeholder="例:123456@qq.com">
  24. </div>
  25. <div class="blog">
  26. <label for="ublog">博客:&nbsp;&nbsp;&nbsp;</label>
  27. <input type="url" name="blog" id="ublog" value="http://" />
  28. </div>
  29. </fieldset>
  30. <fieldset>
  31. <legend>用户基本信息</legend>
  32. <div class="sex">
  33. <label for="secret">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;性别:</label>
  34. <input type="radio" name="sex" value="man" id="man"><label for="man"></label>
  35. <input type="radio" name="sex" value="women" id="women"><label for="women"></label>
  36. <input type="radio" name="sex" value="secret" id="secret" checked><label for="secret">保密</label>
  37. </div>
  38. <div class="age">
  39. <label for="uage"> &nbsp; &nbsp;&nbsp;&nbsp;&nbsp; 年龄:</label>
  40. <input type="number" name="age" id="uage" value="18" min="18" max="100" />
  41. </div>
  42. <div class="birthday">
  43. <label for="ubirthday">出生日期:</label>
  44. <input type="date" name="birthday" id="ubirthday" value="2000-01-01">
  45. </div>
  46. <div class="hobby">
  47. <label> &nbsp; &nbsp;&nbsp;&nbsp;&nbsp; 爱好:</label>
  48. <input type="checkbox" name="hobby[]" value="game" id="game" checked><label for="game">游戏</label>
  49. <input type="checkbox" name="hobby[]" value="trave" id="trave"><label for="trave">旅游</label>
  50. <input type="checkbox" name="hobby[]" value="shoot" id="shoot"><label for="shoot">摄影</label>
  51. <input type="checkbox" name="hobby[]" value="program" id="program" checked><label for="program">编程</label>
  52. </div>
  53. <div class="edu">
  54. <label for=""> &nbsp; &nbsp;&nbsp;&nbsp;&nbsp; 学历:</label>
  55. <select name="" id="">
  56. <option value="" selected disabled>--请选择--</option>
  57. <option value="0">文盲</option>
  58. <optgroup label="义务教育">
  59. <option value="1">小学</option>
  60. <option value="2" >初中</option>
  61. <option value="3">高中</option>
  62. </optgroup>
  63. <optgroup label="高等教育">
  64. <option value="4">大学</option>
  65. <option value="5">硕士</option>
  66. <option value="6">博士</option>
  67. </optgroup>
  68. </select>
  69. <div class="like">
  70. <label for="keyword">编程语言:</label>
  71. <input type="search" name="lang" list="details" id="keyword">
  72. <datalist id="details" >
  73. <option value="html">html</option>
  74. <option value="css">css</option>
  75. <option value="js">js</option>
  76. <option value="php">php</option>
  77. <option value="java">java</option>
  78. <option value="python">python</option>
  79. </datalist>
  80. </div>
  81. </div>
  82. <div class="progress">
  83. <label >填写进度:</label>
  84. <progress name="progress" max="100" value="10"></progress>
  85. </div>
  86. </fieldset>
  87. <fieldset>
  88. <legend>个人简介</legend>
  89. <div class="upload">
  90. <label for="upic">个人照片:&nbsp;&nbsp;&nbsp;</label>
  91. <input type="file" name="user_pic" id="upic" />
  92. <button type="button">上传</button>
  93. </div>
  94. <div>
  95. <label for="comment">个人简介:</label>
  96. <textarea name="comment" id="comment" cols="30" rows="10" maxlength="200" style="resize:none"></textarea>
  97. </div>
  98. </fieldset>
  99. <button>提交</button>
  100. </form>
  101. </body>
  102. </html>
上一条:表单与提交下一条:HTML里的form表单
声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议