PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Limiting users to one form submission

  1. I would like to limit visitors to one submission. I know this has to do with cookies and such, but I don't quite know how to do that with WordPress specifically. Basically, I want to set a cookie that checks if the particular user has submitted a form. If so, then a message displays that the form has already been submitted and the form is grayed out (or just not displayed at all). I must not be using the setcookie() function correctly. Is there a specific way that WordPress handles cookies?

    Posted 10 years ago on Tuesday October 4, 2011 | Permalink
  2. There are two ways to handle this, neither involve cookies.

    The easiest way to handle this is to limit it by email address. Add an email field, or edit an existing email field and set it to No Duplicates. It will only allow one entry with that email address once you do that. It limits it to one form submission per email at that point. Which may or may not be sufficient.

    If the users are WordPress users who will be logged in, you could do some custom code to query the entry data to check for entries using that user ID and then choose to display the form or not using custom PHP.

    Limiting submissions to X per WordPress user is a feature we plan on adding in the future.

    Posted 10 years ago on Tuesday October 4, 2011 | Permalink
  3. riskiii
    Member

    I am looking at using the second option. Can you point me to a code fragment on querying the user id and form number out of the data? I know how to do it in WordPress, just not query the forms data.

    Posted 10 years ago on Thursday November 3, 2011 | Permalink
  4. I am also really interested in in this upcoming feature of limiting only one submission per WP user.

    Posted 10 years ago on Sunday November 13, 2011 | Permalink
  5. cju
    Member

    "I am looking at using the second option. Can you point me to a code fragment on querying the user id and form number out of the data? I know how to do it in WordPress, just not query the forms data."

    Ditto ... could really use a little chunk of example code to get started with this.

    Posted 9 years ago on Friday December 30, 2011 | Permalink
  6. sriganesh
    Member

    Would like that feature to be implemented soon.

    Posted 9 years ago on Monday January 2, 2012 | Permalink