开发者

conditionally checking a value in PloneFormGen

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开发者_如何学JAVA.

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


Although it could be written more simply with path notation, there's nothing wrong with this. So, your problem is probably elsewhere.

Simpler:

<tal:block tal:condition="exists:request/form/my-field-name">
content
</tal:block>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜