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

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.

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.

You'll need to have a background loop that polls your server to see if there are any remaining slots available. Once that counter reaches zero you'd hide the form and replace it with another message.

A standard JavaScript timer that trips an AJAX script load should suffice.