【发布时间】:2014-03-28 14:14:12
【问题描述】:
我可以为表单创建映射,其中第一个验证取决于第二个值吗?
val orderForm = Form(
mapping(
"requiredDelivery" -> boolean,
"deliveryAddress" -> text,
"comment" -> text)
(Order.apply)(Order.unapply)
)
如果requiredDelivery 是true,我想检查deliveryAddress 中的nonEmptyText
【问题讨论】:
标签: forms validation playframework-2.0