diff options
author | Robert Jaros <rjaros@finn.pl> | 2019-12-02 10:02:26 +0100 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2019-12-02 10:02:26 +0100 |
commit | ff01aaf8ca434488a8566dc48314e933347628ef (patch) | |
tree | 0c6200862895b1c7137ff49db3722f3a6a633ebd /src/main | |
parent | 55b6375d13cf1aea369b522068335ccb0101f7a6 (diff) | |
download | kvision-ff01aaf8ca434488a8566dc48314e933347628ef.tar.gz kvision-ff01aaf8ca434488a8566dc48314e933347628ef.tar.bz2 kvision-ff01aaf8ca434488a8566dc48314e933347628ef.zip |
Exclude invisible fields from form validation
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/form/Form.kt | 2 |
1 files changed, 1 insertions, 1 deletions
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<K : Any>(private val panel: FormPanel<K>? = null, private val seriali @Suppress("UNCHECKED_CAST") val fieldsParams = (entry.value as? FieldParams<FormControl>) 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 |