0

I'm working on a Drupal 8 project where I need to show closed webforms as read-only form (without submit button and possibility to answer them), but Webform behaviour doesn't fit my need, as it only display a message "Sorry...This form is closed to new submissions." without displaying the webform.

Is their any way/hook that will allow me to display these closed webform?

0

You would need to not close the form but use hook_webform_submission_form_alter() to change all elemnts to be readonly and hide the submit buttons.

  • Thanks for you answer but how can I set the status of my form to close / open if I need to set the status of the form to always open ? Is their any way to handle status of the form and show a readonly form ? – Sylvain Nov 30 '17 at 13:14
  • The existing closed form logic can't be altered. You will have to write custom close form logic. For example, you would have to override the form status when it is loaded, determine if it is closed, override this state to reopen the form and then set rendered form to be readonly – jrockowitz Dec 3 '17 at 21:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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