禁用Symfony 2 Type中的选择字段的后端验证 [英] Disable backend validation for choice field in Symfony 2 Type
问题描述
是否可以禁用指定字段的后端(服务器端)验证?
Wnen Im试图使用动态加载的选项发送表单我收到错误ERROR:此值无效。
我认为symfony正在检查我的值是否在默认的声明列表上(在我的情况下是它的空列表),如果不是,则返回false。 / div>
我找到了解决方案
Is it possible to disable backend (server-side) validation for the specified field?
Wnen Im trying to send form with dynamicly loaded options I get error "ERROR: This value is not valid."
I think symfony is checking if my value is on the default declared list (in my case its empty list), if not returns false.
I found the solution
Symfony2.4 form 'This form should not contain extra fields' error
For more details: http://symfony.com/doc/current/cookbook/form/dynamic_form_modification.html#cookbook-dynamic-form-modification-suppressing-form-validation
这篇关于禁用Symfony 2 Type中的选择字段的后端验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!