有条件地检查 PloneFormGen 中的值
我有一个信息请求表单,其中包含一系列我想有条件测试的复选框,如果选中,我想向页面添加内容。
我遇到的问题是我找不到添加到模板中以实现此目的的正确语法:
目前我有:
<tal:block condition="python:request.form.get('my-field-name')">
content
</tal:block>
但我没有得到输出,而且我知道必须有一种简单的方法来完成此操作但我找不到任何处理此类请求的文档。如果有人能指出我正确的方向,那会有很大帮助
I have an information request form that has a series of checkboxes that i want to conditionally test and if checked I want to add content to the page.
The issue I'm having is that I can't find the the proper syntax to add to the template to make this happen:
curently i have:
<tal:block condition="python:request.form.get('my-field-name')">
content
</tal:block>
but I get no output, and I know there must be an easy way to get this done but I can't find any documentation dealing with this type of request. if someone could point me in the right direction that'd be of much help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
虽然可以用路径表示法写得更简单,但这并没有什么问题。所以,你的问题可能在其他地方。
更简单:
Although it could be written more simply with path notation, there's nothing wrong with this. So, your problem is probably elsewhere.
Simpler: