kvision / pl.treksoft.kvision.form / Form / add

add

fun <C : FormControl> add(key: String, control: C, required: Boolean = false, validatorMessage: (C) -> String? = null, validator: (C) -> Boolean? = null): Form<K>

Adds a control to the form.

Parameters

key - key identifier of the control

control - the form control

required - determines if the control is required

validatorMessage - optional function returning validation message

validator - optional validation function

Return
current form