json-schema-form / angular-schema-form

Generate forms from a JSON schema, with AngularJS!
https://json-schema-form.github.io/angular-schema-form
MIT License
2.47k stars 653 forks source link

Accordion or collapse #800

Closed thedevdavid closed 7 years ago

thedevdavid commented 7 years ago

Enhancement

As a developer, I want to be able to hide/show some fields of my form by using collapse or accordion. I tried it in this way: I created a checkbox and styled it to look like a button. And using condition to hide/show fields.

Expected behaviour

I expected it to work.

Actual behaviour

It actually validating the checkbox. And if it's in false, the form doesn't care about the hidden elements. But if the checkbox is true, it validates.

I want to find some way or use something to hide/show fields and validate the hidden fields too.

Can anybody help me how can I use something like a bootstrap collapse/accordion?

@json-schema-form/angular-schema-form-lead

Anthropic commented 7 years ago

Hi @DLevai94 try the code that @deyceg was awesome enough to share in #329 It is using UI Bootstrap's accordion, so you would need to include that too. https://gist.github.com/deyceg/6a3bfe870f258ef839b3aaf6b1c5a912

mustafawani commented 7 years ago

Can you please provide form schema for accordian