Created
December 17, 2012 10:29
-
-
Save gakuzzzz/4317301 to your computer and use it in GitHub Desktop.
数値with必須チェック
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import play.api.data.Form | |
import play.api.data.Forms._ | |
import play.api.data.validation.Constraints._ | |
val taskForm = Form( | |
single( | |
"hoge" -> nonEmptyText.verifying(pattern("""-?\d+""".r, error = "number")).transform[Int](_.toInt, _.toString) | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment