【发布时间】:2014-02-21 13:08:58
【问题描述】:
我在 Symfony 1.4 中的一个应用程序中存在一个错误,在一个简单表单的页面中:
$this->widgetSchema['list'] = new sfWidgetFormDoctrineChoice(array('multiple' => true, 'model' => 'Object', 'expanded' => true));
此代码显示复选框列表。 数据已成功从数据库加载。 在表格上,我可以检查每个选项并验证我的表格。 但无法取消选中已“选中”的选项
<ul class="list">
<li>
<input name="sf_guard_user_profile[list][]" type="checkbox" value="1" id="sf_guard_user_profile_list_1" />
<label for="sf_guard_user_profile_list_1">Option 1</label>
</li>
<li>
<span class="checked">
<input name="sf_guard_user_profile[list][]" type="checkbox" value="2" id="sf_guard_user_profile_list_2" checked="checked" />
<label for="sf_guard_user_profile_list_2">Option 2</label>
</span>
</li>
</ul>
有人有想法吗?
【问题讨论】:
-
这看起来与 symfony/doctrine 无关,而更像是一个 html 或 javascript 错误。你能把所有的JS都贴在页面上吗?另外,您的第一个复选框 id 与第二个不匹配是否正常?
标签: doctrine-orm symfony1 symfony-1.4