简体   繁体   English

Drupal Webform表单动作

[英]Drupal webform form action

I'm adding a form to a Drupal website. 我正在向Drupal网站添加表单。 I've created a new page, and created a webform, the webform has been assigned to the page content as a block. 我创建了一个新页面,并创建了一个Web表单,该Web表单已作为块分配给页面内容。

The problem I'm having is when submitting the form, instead of showing the errors of the form at the top of the page like the rest of the forms do, the form action is set to the individual web form page, and any styling/content blocks disappear. 我遇到的问题是提交表单时,没有像其他表单一样在页面顶部显示表单错误,而是将表单操作设置为单独的Web表单页面,以及任何样式/内容块消失。

Essentially what I need to do is ensure the form posts to the same page, if I edit the form action in dev tools, the errors show fine at the top of the page. 本质上,我需要做的是确保表单发布到同一页面,如果我在开发工具中编辑表单操作,则错误会在页面顶部很好地显示。

EDIT: Should also add - I've setup the page and wbeform as per all the others, and they all function as they should and post to the same URL as the page. 编辑:还应该添加-我已经按照其他所有设置页面和wbeform,它们都按其应有的功能运行,并发布到与该页面相同的URL。

Any help appreciated. 任何帮助表示赞赏。

Thanks 谢谢

If you are using the Webform module then you can go to the configuration page of the block in the 'Blocks' section, and look for the following checkbox: 如果您使用的是Webform模块,则可以转到“块”部分中的块的配置页面,并查找以下复选框:

Show all webform pages in block

The description under the checkbox tells you that anything that has to do with the webform (includes errors) will be shown on the current page, instead of redirecting you to the original webform page: 复选框下的描述告诉您,与Web表单相关的任何操作(包括错误)都将显示在当前页面上,而不是将您重定向到原始Web表单页面:

By default multi-page webforms redirect to the node page for all pages after the first one. If checked, all pages will be shown in the block instead.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM