Hide form forever once submitted
Is it possible to create a form that only displays if the user hasn't ever completed it?
开发者_如何学PythonOnce it has been completed, the form should never display again.
Thanks
In order to achieve this you will need some way to track users. Depending on how your site is designed there are different ways to achieve this.
If in order to submit the form the user has to be authenticated you could associate some flag with the current user indicating if he already submitted the form. So before showing the form you check the flag and show the form to the user. Once he submits it you update the flag so that the next time the user tries to load the form the application will known that he already submitted it.
If it is anonymous site you could use cookies to track users. Remember that cookies could be disabled, deleted, manipulated by the user so this is not a reliable way.
精彩评论