博主信息
博文 26
粉丝 0
评论 0
访问量 18761
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
1018作业:表单
高空中的云
原创
615人浏览过

表单作业

用到了input select textarea progress 这四个标签
其中,input用到了若干不同的type,如:type=text type=password type=radio type=file type=checkbox type=radio type=date

完成表单截图

效果图

完整表单代码

  1. <form action="updateCompany.php" id="updatecompany" target="_self" method="POST" enctype="multipart/form-data">
  2. <fieldset>
  3. <legend>企业基本信息</legend>
  4. <div class="companyname">
  5. <label for="companyname">企业名称<span>*</span>:</label>
  6. <input type="text" id="companyname" name="companyname" placeholder="企业全称" required>
  7. </div>
  8. <!-- 正常省市县(区)是三级联动,需要js和预设地区数据,这里仅展示 -->
  9. <div class="address">
  10. <label for="address">通讯地址<span>*</span>:</label>
  11. <select name="address_province" id="address_province">
  12. <option value="" disabled selected>--请选择省份--</option>
  13. <option value="山东省">山东省</option>
  14. <option value="河北省">河北省</option>
  15. <option value="江苏省">江苏省</option>
  16. </select>
  17. <select name="address_city" id="address_city">
  18. <option value="" disabled selected>--请选择市--</option>
  19. <option value="济南市">济南市</option>
  20. <option value="石家庄市">石家庄市</option>
  21. <option value="南京市">南京市</option>
  22. </select>
  23. <select name="address_district" id="address_district">
  24. <option value="" disabled selected>--请选择区--</option>
  25. <option value="历下区">历下区</option>
  26. <option value="长安区">长安区</option>
  27. <option value="鼓楼区">鼓楼区</option>
  28. </select>
  29. <input type="text" id="address" name="address" placeholder="详细街道地址" required>
  30. <output style="color: lightgray;">因省市县(区)三级联动需用到数据和js,这里仅做html结构演示</output>
  31. </div>
  32. <!-- -->
  33. <div class="picture">
  34. <label for="picture">营业执照<span>*</span>:</label>
  35. <input type="file" id="picture" name="picture" placeholder="请选择营业执照" required>
  36. </div>
  37. <div class="valid">
  38. <label for="valid">有效期至(营业执照)<span>*</span>:</label>
  39. <input type="date" name="valid" value="2022-10-18" id="valid" min="2022-10-18" max="2099-01-01" />
  40. <output>or</output>
  41. <input type="checkbox" name="valid_long" id="valid_long" ><label for="valid_long">长期</label>
  42. </div>
  43. <div>
  44. <label for="description">企业简介:</label>
  45. <!-- textarea: 没有value属性,它的值位于textarea标签之间 -->
  46. <textarea name="description" id="description" cols="30" rows="5">企业的简单文字介绍</textarea>
  47. </div>
  48. </fieldset>
  49. <fieldset>
  50. <legend>企业账户信息</legend>
  51. <div class="account">
  52. <label for="account">登录账号<span>*</span>:</label>
  53. <input type="text" id="account" name="account" placeholder="登录账号" required>
  54. </div>
  55. <div class="pwd">
  56. <label for="pwd">登录密码<span>*</span>:</label>
  57. <input type="password" id="pwd" name="pwd" placeholder="密码" minlength="6" required>
  58. </div>
  59. <div class="status">
  60. <label for="status">账户状态<span>*</span>:</label>
  61. <input type="radio" name="status" value="open" id="open"><label for="open">开启</label>
  62. <input type="radio" name="status" value="closed" id="closed"><label for="closed">关闭</label>
  63. <input type="radio" name="status" value="check" id="check" checked><label for="check">审核中</label>
  64. </div>
  65. <div class="authority">
  66. <label>账户权限:</label>
  67. <input type="checkbox" name="authority[]" value="edit" id="edit"><label for="edit">修改企业基本信息</label>
  68. <input type="checkbox" name="authority[]" value="news" id="news"><label for="news">发布更新资讯</label>
  69. <input type="checkbox" name="authority[]" value="employee" id="employee"><label for="employee">审核员工信息</label>
  70. </div>
  71. </fieldset>
  72. <div class="progress">
  73. <label for="">信息填写完成度</label>
  74. <progress name="progress" max="100" value="35"></progress>
  75. <output>35%</output>
  76. </div>
  77. <button type="button">提交</button>
  78. </form>
批改老师:PHPzPHPz

批改状态:合格

老师批语:
本博文版权归博主所有,转载请注明地址!如有侵权、违法,请联系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+教程免费学