formio / formio.js

JavaScript powered Forms with JSON Form Builder
https://formio.github.io/formio.js
MIT License
1.89k stars 1.06k forks source link

Required fields required in hidden Panel #806

Closed krixerx closed 5 years ago

krixerx commented 5 years ago

We have multiple panels with required fields.

If the panel is not visible (hidden by jsonLogic condition) then the fields on hidden panel should be not required.

But when we use javascript condition instead of jsonLogic then it works fine (required fields on hidden Panel are not required).

randallknutson commented 5 years ago

Can you provide an example form that doesn't work correctly? You are right that hidden fields shouldn't trigger any validation logic but all the testing we've done it worked correctly.

krixerx commented 5 years ago

Thank you very much for reply!

Example is here with two panels (Panel2 is visible when number on Panel1 has value 10): https://bpa-dev.eregistrations.org/formio/paneltest

jeriah-formio commented 5 years ago

Hello @krixerx ,

I recreated the form using the embed code you provided and our testing is showing validation is working properly.

Validation is not triggered when form is submitted and panel is hidden - https://screencast.com/t/o3qE1kD6de Validation is triggered when panel is displayed and required field is not honored - https://www.screencast.com/t/o3qE1kD6de

Could you please provide more information on the issue happening on your end

krixerx commented 5 years ago

Hi!

Thank you very much supporting us! The problem was in our extended formio server. Our formio server is extended with some other libraries (jquery, dom) to execute some externals (REST calls) validations in sandbox. After updating all libraries everything works fine.

Thank you again and take care :-) Erki