Closed (duplicate)
Project:
Webform
Version:
5.x-2.4
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
22 Jan 2009 at 17:49 UTC
Updated:
14 Feb 2009 at 04:29 UTC
I have Views providing a Block with a single Webform node in it. This Block is then placed on other nodes in the site. This works just fine, but when there is a submission error due to the form not passing validation, Webform displays the errors on the node/*** page with only the form displayed. This takes it out of the context of the original page.
My question is whether there is a way for Webform to display it's errors within the Block and not redirect to it's node page?
Comments
Comment #1
quicksketchIt's a tricky problem and it's the reason #248157: Allow any Webform to be displayed as a block is not an official feature. You might try this code in the header of your View (use the PHP input format):
Basically it's a crude check to see if a Webform submission has occurred, and if so, printout the status messages in the header of the block.
Comment #2
jschulz-1 commentedThanks a lot for that idea. It kind of works if I add this code to Additional Validation section (to return them to the same page instead of node/***).
That displays the messages in the Block then, but the forms fields don't get the "error" class set on them.
Also, it clears what the form values, so it's a blank form.
Comment #3
quicksketchLet's just consolidate the efforts in #248157: Allow any Webform to be displayed as a block. If we fix it there we don't have to keep making custom solutions every time someone wants to do this.