博客列表 >form表单制作

form表单制作

至亲难忘
至亲难忘原创
2023年03月15日 13:58:31305浏览
  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>Document</title>
  8. </head>
  9. <body>
  10. <!-- action:处理表单数据脚本的url地址 -->
  11. <!-- method:表单的提交方式 -->
  12. <from action="register.php" method="post">
  13. <!-- fieldset:表单空件的分组 -->
  14. <fieldset style="display: inline-grid; gap: 1em">
  15. <legend>用户注册</legend>
  16. <div class="username">
  17. <label for="">用户名:</label>
  18. <!-- type="text":单行文本框 -->
  19. <!-- autofocus:页面初始化/加载成功时,焦点自动落入。 -->
  20. <!-- required:必填项,不写不能提交 -->
  21. <input type="text" id="username" name="username" value="" placeholder="不少于六位数" autofocus required>
  22. </div>
  23. <div class="email">
  24. <label for="email">邮箱:</label>
  25. <input type="email" id="email" name="email" placeholder="请输入正确的格式!" required>
  26. </div>
  27. <div class="password">
  28. <label for="">密码:</label>
  29. <input type="password" id="password" name="password" placeholder="输入不少于6位数的密码" required>
  30. <button>查看</button>
  31. </div>
  32. <div class="age">
  33. <label for="age">年龄:</label>
  34. <input type="number" id="age" name="age" min="18" max="80">
  35. </div>
  36. <div class="birthday">
  37. <label for="birthday">生日:</label>
  38. <input type="date" id="birthday" name="birthday" value="2008-08-08" min="1949-10-01">
  39. </div>
  40. <div class="sex">
  41. <label for="sex">性别:</label>
  42. <input type="radio" name="sex" value="male" id="male" checked><label for="male"></label>
  43. <input type="radio" name="sex" value="male" id="female"><label for="male"></label>
  44. <input type="radio" name="sex" value="male" id="secret"><label for="male">保密</label>
  45. </div>
  46. <div class="hobby">
  47. <label for="">爱好:</label>
  48. <input type="checkbox" name="hobby[]" value="trave" id="trave"><label for="trave">旅游</label>
  49. <input type="checkbox" name="hobby[]" value="trave" id="programe"><label for="programe">编程</label>
  50. <input type="checkbox" name="hobby[]" value="trave" id="shoot"><label for="shoot">摄影</label>
  51. <input type="checkbox" name="hobby[]" value="trave" id="food"><label for="food">美食</label>
  52. </div>
  53. <div class="education">
  54. <label for="">学历:</label>
  55. <select name="education">
  56. <option value="1">中学</option>
  57. <option value="2">高中</option>
  58. <option value="3">大学</option>
  59. <option value="4">研究生</option>
  60. </select>
  61. </div>
  62. <button>提交</button>
  63. </fieldset>
  64. </from>
  65. </body>
  66. </html>
声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议