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.

Display description and hide form fields based on cookie value

  1. Stylmark
    Member

    Is it possible using the gform_pre_render to either render the form as normal or just display the description based on a cookie value? I'm looking to build a voting system that only allows one submission per day and I want to have the form description be used as the displayed text when a form has already been submitted.

    Posted 7 years ago on Monday September 26, 2011 | Permalink
  2. I think gform_pre_render is too late.

    I would probably approach it either in the page template. Put the function call to the form there. Wrap it in a conditional based on whether or not the cookie value is true or false. If the form has been submitted, display the "only one submission per day" message instead of the form.

    There might be a WordPress plugin that restricts access to content based on the value of a cookie as well, but I have not ever looked for one.

    I think gform_pre_render is the wrong way to approach it.

    Posted 7 years ago on Tuesday September 27, 2011 | Permalink