0

I can not hide webform block by Per user submission limit.

I choose Per user submission limit = 1- > ever, but block is shown.

How can I hide the block, if it was submitted?

4
  • Can you clear it is for D7 or D8 and Is anonymous user access to submit form ? Oct 31, 2017 at 13:17
  • Sorry, it is D7
    – Evi
    Oct 31, 2017 at 13:45
  • Is anonymous user access to submit form ? Oct 31, 2017 at 13:49
  • Yes, they can submit, after submission and reload the page, webform block shown again and in that time they can not submit, but block is shown (
    – Evi
    Oct 31, 2017 at 13:52

1 Answer 1

0

When a visitor submit a form, cookie with a name "webform-123" (123 - webform ID) save in his browser. In the block visibility settings use the cookie existence check with PHP:

<?php 
$match = FALSE;
if(!isset($_COOKIE['webform-123'])) {
$match = TRUE; 
}
return $match;
?>

If the cookie does not exist, the condition will return the TRUE and the block will be displayed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.