Closed (duplicate)
Project:
Webform
Version:
6.x-3.0-beta2
Component:
Documentation
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
12 May 2007 at 08:34 UTC
Updated:
3 Apr 2010 at 03:18 UTC
It would be nice to be able to prevent further submissions to a webform. It would be useful in a situation, where some data needs to be collected only fixed number of times or until a certain deadline.
Possible options:
Comments
Comment #1
quicksketchIs the requirement for this more complicated than just unpublishing the node? That way it is still accessible to administrators but hidden from normal users. Several modules already exist to publish/unpublish on certain conditions or dates.
Comment #2
abaryudin commentedNo, it would be more useful if the form (at least, the text) stayed there, but the form would be disabled and replaced with some "No more submissions" messages. This is better than unpublishing, since I don't want users to see a "Access denied" message.
Comment #3
abaryudin commentedTo emphasize the importance of limited submission, have a look at the current development version of the sign-up module - it has an option to limit the number of subscriptions.
Comment #4
quicksketchWe'll likely be implementing a sort of access control for webform submissions at http://drupal.org/node/239343. By unchecking all roles that are allowed to submit a particular webform, it effectively disables further form submissions. Once finished you could effectively limit submissions with additional processing code such as this:
Marking as duplicate, let's follow the progress of the other issue.
Comment #5
benstallings commentedEven if unpublishing the node is acceptable, doing so doesn't disable the form from submission. That is, if someone loads the form in their browser while it's published, sits on it for a few minutes or hours, and then submits it, the submission is accepted even if the node has been unpublished in the meantime. This can be problematic for some of us!
Using the following code for Additional Validation solves the problem:
Comment #6
quicksketchThis problem has been corrected in #376574: Page cache interferes with submit limit for anonymous users.