Symfony2嵌入表单标签

时间:2014-07-10 07:38:26

标签: forms symfony label

我已经为文件上传创建了嵌入式表单,但是当我添加新文件上传输入元素时,它会添加标签" label __"

enter image description here

这很烦人,我想删除它。我尝试通过修改来自http://symfony.com/doc/current/cookbook/form/form_collections.html的代码从

中删除它
newForm = prototype.replace(/__name__/g, ''),

newForm = prototype.replace(/__name__label__/g, ''),

然后它停止工作(只上传了最后一个文件)。我当然可以用css隐藏它,但是我想删除它,或者把它改成有意义的东西,我该怎么办呢?

1 个答案:

答案 0 :(得分:1)

我遇到了同样的问题,我把这部分js改为:

prototype = prototype.replace(/<label(.*)__name__label__<\/label>/i, '');
var newForm = prototype.replace(/__name__/g,index);
相关问题