Orchard自定义表单DropDownLists [英] Orchard Custom Form DropDownLists

查看:272
本文介绍了Orchard自定义表单DropDownLists的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用Orchards的自定义窗体模块进行一些操作后,我决定使用一个下拉列表来选择一个特定的人,他们的电子邮件作为所选选项的值。虽然我创建的形式我无法看到,无论如何你可以设置值到您的选项。

After a bit of playing around with Orchards' Custom Forms module, i decided i wanted to use a dropdownlist to select a particular person with their email as the value for that selected option. While i was creating the form i couldn't see anyway you could set values to your options.

请参见下面的图像例如:

See below image for example:

不要假定有人遇到过

推荐答案

在您的情况下,我不担心为字段使用不同的文本和值。将收件人的电子邮件作为HTML表单的输入也是有潜在危险的。

In your case I wouldn't worry about having different text and values for the fields. It's also potentially dangerous to make the recipient email an input of the HTML form.

Orchard提供的自定义表单规则事件无法查看内容类型由表单创建。所以,你可能要写自己的。您应该能够将此基于Orchard.CustomForms.Rules.CustomFormEvents。

The Custom Form Rule Event provided with Orchard gives you no way to look at the values of the content type created by the form. So, you're probably going to have to write your own. You should be able to base this on Orchard.CustomForms.Rules.CustomFormEvents.

使用此功能,您可以为每个可能的下拉值创建新规则,并设置每个规则的操作中的电子邮件地址。

Armed with this you'd be able to create new rules for each possible dropdown value and set the email address in the action for each rule.

这篇关于Orchard自定义表单DropDownLists的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆