我正在使用站点范围内的联系我们表单,但是当用户单击“发送电子邮件”提交按钮时,工作流程会自动将用户带到主页,而不显示任何类型的消息,这对最终用户来说可能非常不方便。
但如果用户未提供主题或其他错误,则会正确报告。如何显示“消息提交成功”的消息?
另外,我们如何将“发送电子邮件”提交按钮文本更改为“发送消息”?
I am using site-wide contact Us form, but when user click "send email" submit button, the workflow automatically take the user to home page, without showing any sort of message, which could be very inconvenient for end user.
But in case user did not supply subject or other mistake, than it is properly reported. How can we show 'message successfully submitted' message?
Also, how can we change "send email" submit button text to "send message"?
发布评论
评论(1)
请查看此处的博客文章:http:// www.isegura.es/blog/modifying-contact-form-drupal-how-add-field
您需要按照此处所述实现 hook_form_alter(),然后您可以覆盖提交文本。我建议您安装 devel.module ,然后使用 dpm($form) 来查看该表单是如何构建的,或者查看 http://api.drupal.org/api/drupal/modules--contact--contact.pages.inc/function/contact_mail_page/ 6.。
像这样的事情应该可以解决问题:
要打印消息,您可以将自己的提交回调添加到该数组,然后在那里打印消息。
Have a look at the blog post here: http://www.isegura.es/blog/modifying-contact-form-drupal-how-add-field
You need to implement hook_form_alter() as described there, then you can override the submit text. I suggest you install devel.module and then use dpm($form) to see how that form is built or have a look at http://api.drupal.org/api/drupal/modules--contact--contact.pages.inc/function/contact_mail_page/6.
Something like this should do the trick:
To print a message, you can add your own submit callback to that array and then print a message there.