Search code examples
http-redirectdrupal-7drupal-webform

Drupal 7 Webform redirect


We have a Drupal 7 webform that redirects to a url upon successful submission.

What we need to do is redirect the user if they land on the same webform again and have already submitted.

Do we need a module for this, or do it programmatically?

Thanks in advance.


Solution

  • So here is the solution that we ended up going with.

    1. I saved the webform and made it available as a block
    2. I created a page to hold the webform
    3. I configured the block to appear above the page content
    4. In the page content I put in some javascript to detect if the form element was present - if not forward to the correct url

    So the webform redirects correctly upon submission(set in the webform settings), and it then redirects if the user lands back on that page and has completed the webform.