Field

play.api.data.Field
case class Field(form: Form[_], name: String, constraints: Seq[(String, Seq[Any])], format: Option[(String, Seq[Any])], errors: Seq[FormError], value: Option[String])

A form field.

Value parameters

constraints

the constraints associated with the field

errors

the errors associated to this field

format

the format expected for this field

name

the field name

value

the field value, if any

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def apply(key: String): Field

Retrieve a field from the same form, using a key relative to this field key.

Retrieve a field from the same form, using a key relative to this field key.

Value parameters

key

Relative key.

Attributes

Inherited methods

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product

Concrete fields

lazy val error: Option[FormError]

Returns the first error associated with this field, if it exists.

Returns the first error associated with this field, if it exists.

Attributes

Returns

an error

lazy val hasErrors: Boolean

Check if this field has errors.

Check if this field has errors.

Attributes

lazy val id: String

The field ID - the same as the field name but with '.' replaced by '_'.

The field ID - the same as the field name but with '.' replaced by '_'.

Attributes

lazy val indexes: Seq[Int]

Retrieve available indexes defined for this field (if this field is repeated).

Retrieve available indexes defined for this field (if this field is repeated).

Attributes

lazy val label: String

The label for the field. Transforms repeat names from foo[0] etc to foo.0.

The label for the field. Transforms repeat names from foo[0] etc to foo.0.

Attributes