使用 Symfony2 如何让表单验证器至少需要一组字段中的一个? [英] With Symfony2 how can I get the form validator to require at least one of a set of fields?

查看:20
本文介绍了使用 Symfony2 如何让表单验证器至少需要一组字段中的一个?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个供您填写家庭、手机或工作电话号码的任意组合的位置.

I have a from where you can fill in any combination of your home, cell, or work phone numbers.

如何让验证器要求至少填写一个而不需要单独填写任何字段?

How can I get the validator to require that at least one is filled in without requiring any of the fields individually?

推荐答案

您至少有两个选择:

这篇关于使用 Symfony2 如何让表单验证器至少需要一组字段中的一个?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆