果园自定义窗体DropDownLists

果园自定义窗体DropDownLists

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

问题描述

一点果园自定义表单模块玩耍后,我决定用一个DropDownList选择他们作为该选择的选项值电子邮件一个特定的人。而我在创建表单我看不到,反正你能值设置选项。

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:

你们不要想任何人都碰到过在此之前或有什么建议?

Don't suppose anybody has come across this before or has a suggestion?

推荐答案

在你的情况我就不会担心有不同的文本和值的字段。这也是潜在的危险,使收件人电子邮件的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.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.

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

08-14 14:45