Orchard Custom Form DropDownLists

2020-04-08 14:49发布

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: Orchard Custom Form Content Type

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

1条回答
贼婆χ
2楼-- · 2020-04-08 15:23

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.

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.

查看更多
登录 后发表回答