Zend Form:添加和编辑好的,但是视图呢?
按照书中的 Zend 教程,我创建了一个基本表单并将其子类化两次 - 一次用于编辑,一次用于创建。我应该如何创建仅查看版本?
所有查看详细信息与编辑版本相同,但我不希望用户能够编辑任何字段。
作为一个相关问题 - 编辑版本中有一个字段我不希望用户能够编辑。实现这一目标的最佳方法是什么? javascript 是答案吗?
Following a Zend tutorial from a book I have created a Base Form and subclassed it twice - once for Edit, once for Create. How should I go about creating a View only version?
All the View details are the same as the Edit version, but I don't want users to be able to edit any fields.
As a related question - there is one field in the Edit version that I don't want users to be able to edit. What's the best way to achieve this? Is javascript the answer?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
嘿,如果您在基本表单中设置了所有字段,那么您可以执行以下操作:
删除字段
禁用字段,仅查看
我自己从未这样做过,但我猜您可以创建另一个表单并将所有字段设置为禁用。
我希望这有帮助。
Hey if you have all the fields set up in the base form then you can do this:
Remove a field
Disabling fields, view only
Ive never done this myself but I guess you could create another form and set all fields to disabled.
I hope this is helpful.
为了拥有“仅查看”表单,我对“编辑”表单进行了子类化,并包含以下代码:
To have a 'view only' form, I have subclassed the Edit form, and included the following code: