Blogger Information
Blog 5
fans 0
comment 0
visits 4441
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
form 表单控件
小狐的博客
Original
856 people have browsed it

form 表单控件

  1. <link rel="stylesheet" href="style/form.css" />
  2. <h3 class="title">员工信息</h3>
  3. <form action="" method="POST" class="register" enctype="multipart/form-data">
  4. <!-- 1、单行文本框 -->
  5. <!-- type: 控件类型 -->
  6. <!-- name: 数据的变量名 -->
  7. <!-- value: 数据的内容 -->
  8. <label for="username">姓名:</label>
  9. <!-- 通常输入文本框 -->
  10. <input type="text" id="username" name="username" value="" placeholder="username" required />
  11. <!-- 邮箱文本框 -->
  12. <label for="email">邮箱:</label>
  13. <input type="email" id="email" name="email" value="" required placeholder="demo@email.com" />
  14. <!-- 密码文本框 -->
  15. <label for="password">密码:</label>
  16. <input type="password" id="password" name="password" value="" required placeholder="不少于6位" />
  17. <!-- 2、单选框 -->
  18. <label for="secret">性别:</label>
  19. <div>
  20. <!-- 一组单选按钮必须共用同一个名称的name属性值,否则无法实现值的唯一性 -->
  21. <input type="radio" name="gender" value="male" id="male" /><label for="male"></label>
  22. <input type="radio" name="gender" value="female" id="female" /><label for="female"></label>
  23. <input type="radio" name="gender" value="secret" id="secret" checked /><label for="secret">保密</label>
  24. </div>
  25. <!-- 3、复选框 -->
  26. <label for="#">兴趣:</label>
  27. <div>
  28. <!-- 复选框的name属性值应该写与数组的格式名称,这样才确保服务器可以接收到一组值。 -->
  29. <input type="checkbox" name="hobby[]" value="game" id="game" checked /> <label for="game">游戏</label>
  30. <input type="checkbox" name="hobby[]" value="shoot" id="shoot" /> <label for="shoot">摄影</label>
  31. <input type="checkbox" name="hobby[]" value="travel" id="travel" /> <label for="travel">旅游</label>
  32. <input type="checkbox" name="hobby[]" value="tubu" id="tubu" checked /> <label for="tubu">徒步</label>
  33. </div>
  34. <!-- 4、组合框 -->
  35. <label for="edu">部门:</label>
  36. <select name="edu" id="edu">
  37. <option value="1">市场部</option>
  38. <option value="2">综合部</option>
  39. <option value="3">客服部</option>
  40. <option value="4">党群部</option>
  41. </select>
  42. <!-- 5、文件域与隐藏域 -->
  43. <label for="user-pic">头像:</label>
  44. <!-- 隐藏域,在前端页面看不到的,它的值供后端处理时用 -->
  45. <input type="hidden" name="MAX_FILE_SIZE" value="80000" />
  46. <input type="file" name="user_pic" id="user-pic" />
  47. <!-- 头像占位符 -->
  48. <!-- 用于预览头像 -->
  49. <div class="user-pic" style="grid-column: span 2"></div>
  50. <label for="user-resume">简历:</label>
  51. <input type="hidden" name="MAX_FILE_SIZE" value="100000" />
  52. <input type="file" name="user_resume" id="user-resume" />
  53. <!-- 简历占位符 -->
  54. <!-- 用于预览文件使用 -->
  55. <div class="user-resume" style="grid-column: span 2"></div>
  56. <!-- 5. 多行文本域 -->
  57. <label for="comment">备注:</label>
  58. <textarea name="comment" id="comment" cols="30" rows="5"></textarea>
  59. <!-- 提交按钮 -->
  60. <input type="submit" value="提交"/>
  61. </form>

效果预览

Correcting teacher:天蓬老师天蓬老师

Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post