Support » Plugin: Contact Form DB » Hide Contact Form 7 if already submitted

  • Hi – Is there any way to hide a form if the logged in user has already filled in and submitted their data? I’ve seen the Preventing Duplicate Submissions article but I’d like to hide the form from being shown to a person who has already filled it in.

    Is that possible with some code interrogating CFDB? eg. if logged in user and filled in this form then display:none – Something like that.

    Thanks for any help you can give.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Michael Simpson

    (@msimpson)

    I’m not aware of any such thing. If CF7 had a hook that could decide whether or not to display a form, then you could add code like the Preventing Duplicates example, but I’m not aware of such a thing.

    If you are Javascript savvy, then you could make an AJAX all to a CFDB JSON Export URL to get submissions from that users and if found, then have the Javascript hide the DIV that the form appears in or redirect to a different page.

    Thanks for your help Michael.

    I think I’ve got is sorted along the lines of your second paragraph. Added Custom Fields to the mix, set a flag in the user profile and when the user submits the form the flag field is set to 1 with a function. Then there’s another function to hide the form if the flag = 1. Seems to be working. Happy to share if anyone else is ever interested.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hide Contact Form 7 if already submitted’ is closed to new replies.