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.
key
- key identifier of the control
required
- determines if the control is required
validatorMessage
- optional function returning validation message
validator
- optional validation function
Return
current form