From ff01aaf8ca434488a8566dc48314e933347628ef Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Mon, 2 Dec 2019 10:02:26 +0100 Subject: Exclude invisible fields from form validation --- src/main/kotlin/pl/treksoft/kvision/form/Form.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/kotlin') diff --git a/src/main/kotlin/pl/treksoft/kvision/form/Form.kt b/src/main/kotlin/pl/treksoft/kvision/form/Form.kt index 2c71e6a1..8f63662e 100644 --- a/src/main/kotlin/pl/treksoft/kvision/form/Form.kt +++ b/src/main/kotlin/pl/treksoft/kvision/form/Form.kt @@ -297,7 +297,7 @@ class Form(private val panel: FormPanel? = null, private val seriali @Suppress("UNCHECKED_CAST") val fieldsParams = (entry.value as? FieldParams) val required = fieldsParams?.required ?: false - val requiredError = control.getValue() == null && required + val requiredError = control.getValue() == null && control.visible && required if (requiredError) { control.validatorError = trans(fieldsParams?.requiredMessage) ?: "Value is required" true -- cgit