ulion / jsonform

Build forms from JSON Schema. Easily template-able. Compatible with Twitter Bootstrap out of the box.
http://ulion.github.io/jsonform/playground/
MIT License
49 stars 27 forks source link

Conditional toggle between two alternative fields with checkbox or radios #24

Open mjau-mjau opened 9 years ago

mjau-mjau commented 9 years ago

I have used a few methods to display conditional fields with radios and checkbox from this branch. However, I cannot see that it is possible to display conditional fields "A or B" based on radios or checkbox like it works with selectfieldset: http://ulion.github.io/jsonform/playground/?example=fields-selectfieldset

So basically, I would be looking to replace the select with either boolean radios or checkbox, to display either key A or key B. As far as I can understand, with radios and checkbox, it is only possible to toggle display of keys, not toggle between two different keys.

Perhaps there is some trick unknown to me? Thanks for this branch btw.

ulion commented 9 years ago

Then that is simply not supported currently. PR is welcome.

2015-08-18 22:33 GMT+08:00 Karl Ward notifications@github.com:

I have used a few methods to display conditional fields with radiosand checkboxfrom this beanch. However, I cannot see that it is possible to display conditional fields "A or B" based on radios or checkbox like it works withselectfieldset`: http://ulion.github.io/jsonform/playground/?example=fields-selectfieldset

So basically, I would be looking to replace the select with either boolean radios or checkbox, to display either key A or key B. As far as I can understand, with radios and checkbox, it is only possible to toggle display of keys, not toggle between two different keys.

Perhaps there is some trick unknown to me? Thanks for this branch btw.

— Reply to this email directly or view it on GitHub https://github.com/ulion/jsonform/issues/24.

Ulion