Permalink
Browse files

Updated Validation.Length message to be shorter

  • Loading branch information...
darkfrog26 committed Jan 22, 2019
1 parent f9451be commit 1b19b60779389e6feb4e563eda17f551e8e7169e
Showing with 1 addition and 1 deletion.
  1. +1 −1 dom/src/main/scala/io/youi/form/Validation.scala
@@ -24,7 +24,7 @@ object Validation {
}

def Length(minimum: Int = 0, maximum: Int = Int.MaxValue): Validation = {
Conditional(input => (minimum to maximum).contains(input.value.length), name => s"$name must be a minimum of $minimum characters and a maximum of $maximum characters")
Conditional(input => (minimum to maximum).contains(input.value.length), name => s"$name must be between $minimum and $maximum length")
}
def EqualTo(that: FormInput): Validation = Conditional(_.option == that.option, name => s"$name must be equal to ${that.name.capitalize}")
def NotEqual(bad: => String, message: String => String): Validation = Conditional(!_.option.contains(bad), message)

0 comments on commit 1b19b60

Please sign in to comment.