required

val required: Boolean = true

Parameters

required

Whether this form field is optional or not. If true, the form field value is required to be non-null or non-empty to be validated. If false, the field value is optional and will be valid if it is empty or null.

Note that if required is false and the value of this form field is neither null nor empty, the field will be validated as if it were required.