博主信息
博文 56
粉丝 0
评论 4
访问量 48460
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
007第7课:细说表单(重点)+后台框架
异乡客
原创
502人浏览过

  1. <!DOCTYPE html>
  2. <html lang="en">
  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. <br>
  10. <h2>用户注册</h2>
  11. <!-- form + input + select +button ... -->
  12. <!-- <form action="verify.php" method="post">
  13. <input type="" name="username" value="admin" />
  14. <input type="password" name="password" value="" />
  15. <button>提交</button>
  16. </form> -->
  17. <!-- http://127.0.0.1:5500/20211222/verify.php?username=admin -->
  18. <!-- http://127.0.0.1:5500/20211222/verify.php?username=admin&password=12345 -->
  19. <!-- 文本框 -->
  20. <form action="verify.php" method="post" style="display: grid;gap:10px">
  21. <div>
  22. <label for="username">用户名:</label>
  23. <!-- label的for属性和input的id属性必须一致 -->
  24. <input type="text" name="username" id="username" value="" placeholder="至少8位" required />
  25. <!-- placeholder="至少8位" required 提示位数,以及强制填写才能提交 -->
  26. </div>
  27. <!-- 密码框 -->
  28. <div>
  29. <label for="password">密码:</label>
  30. <!-- label的for属性和input的id属性必须一致 -->
  31. <input type="password" name="password" id="password" value="" placeholder="数字+字母,至少6位" required />
  32. <!-- placeholder="至少8位" required 提示位数,以及强制填写才能提交 -->
  33. <button onclick="showPassword(this,this.form.password)" type="button">查看</button>
  34. </div>
  35. <!-- 邮箱 -->
  36. <div>
  37. <label for="email">密码:</label>
  38. <!-- label的for属性和input的id属性必须一致 -->
  39. <input type="email" name="email" id="email" value="" placeholder="类似:xxx@gmail.com" required />
  40. <!-- placeholder="至少8位" required 提示位数,以及强制填写才能提交 -->
  41. </div>
  42. <!-- 单选按钮 -->
  43. <!-- div>label+input*2 -->
  44. <div><label for="">性别</label>
  45. <input type="radio" name="gender" id="" value="male"><label for="male"></label>
  46. <input type="radio" name="gender" id="" value="female"><label for="female"></label>
  47. </div>
  48. <!-- 复选框 -->
  49. <div>
  50. <lable>爱好:</lable>
  51. <input type="checkbox" name="hobby[0]" id="game">
  52. <lable for="game">游戏</lable>
  53. <input type="checkbox" name="hobby[1]" id="trave">
  54. <lable for="trave">旅游</lable>
  55. <input type="checkbox" name="hobby[2]" id="shoot">
  56. <lable for="shoot">摄影</lable>
  57. </div>
  58. <!-- 默认提交,重置 -->
  59. <button></button><button></button><button></button>
  60. <!-- 内联框架和多媒体 -->
  61. <!-- 内联标签:画中画 -->
  62. <a href="https://map.baidu.com/search/%E4%B8%9C%E8%8E%9E%E5%B8%82/@12663667,2618456.75,12z?querytype=s&wd=%E4%B8%9C%E8%8E%9E%E5%B8%82&c=119&provider=pc-aladin&pn=0&device_ratio=1&da_src=shareurl" target="map">东莞市</a>
  63. <iframe src="" frameborder="1" width="500" height="500" name="map"></iframe>
  64. <!-- 多媒体 -->
  65. <video width="" height="" controls>
  66. </video>
  67. <button>提交</button>
  68. </form>
  69. <script>
  70. function showPassword(btn, ele) {
  71. if (ele.type === "password") {
  72. ele.type = "text";
  73. btn.textContent = "隐藏";
  74. } else {
  75. ele.type = "password";
  76. btn.textContent = "显示";
  77. }
  78. }
  79. </script>
  80. </body>
  81. </html>
本博文版权归博主所有,转载请注明地址!如有侵权、违法,请联系admin@php.cn举报处理!
全部评论 文明上网理性发言,请遵守新闻评论服务协议
0条评论
作者最新博文
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号

  • 登录PHP中文网,和优秀的人一起学习!
    全站2000+教程免费学