Orchard Custom Form DropDownLists

只谈情不闲聊 提交于 2019-12-01 20:10:35

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/14685761/orchard-custom-form-dropdownlists

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!