dongzhao2725 2013-02-13 06:01
浏览 7

所有用户在提交后动态隐藏表单

I have a challenge I'm going to start working on soon. I need to dynamically hide a form after a user submits their email address, and also have that form hidden from all other visitors after that event. The closest thing I could find to that is at the link below:

Dynamically hide form on submit?

visitors will enter their email address to claim one of 26 spots in a contest and I don't want multiple entrants for each submit form.

Let me know if I can clarify any more.

  • 写回答

2条回答 默认 最新

  • doudouwen2763 2013-02-13 06:08
    关注

    The page should be dynamically generated such that the form is only rendered if less than 26 emails have been collected.

    Whenever the form is submitted, you should then check to see how many you've collected, and if less than 26, then store the user's email.

    Otherwise, if a user submits the form (because he loaded his page before the 26 emails were collected), then process the submission but check how many you've collected so far, and inform the user that he is too late.

    If you want to go further, you could include an Ajax poll function on every rendered page that continuously checks with the server to see how many emails were collected, and once it reaches 26, you can remove the form automatically from the DOM.

    评论

报告相同问题?

悬赏问题

  • ¥15 关于大棚监测的pcb板设计
  • ¥20 sim800c模块 at指令及平台
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计