Reputation: 51435
I wrote this excellent question:
How to create a custom validator in Play Framework 2.0?
The point is, the solution applies to the Java Play API.
How to write a custom validator in Scala ?
Upvotes: 1
Views: 947
Reputation: 9663
Use the verifying
method on Mapping.
For example:
Form("foo" -> text.verifying{ txt => txt.startsWith("bar") })
Upvotes: 1