gitana / alpaca

Alpaca provides the easiest way to generate interactive HTML5 forms for web and mobile applications. It uses JSON Schema and simple Handlebars templates to generate great looking, dynamic user interfaces on top of Twitter Bootstrap, jQuery UI, jQuery Mobile and HTML5.
http://www.alpacajs.org
Other
1.29k stars 371 forks source link

Implementing richer dependencies #680

Closed codek closed 5 years ago

codek commented 5 years ago

We need to implement more interesting dependencies on the form, for example:

Another field is blank (hence show/enable this one) (Other field in this case is a text box, not a select) Combinatorial syntax over several fields i.e. FieldA is blank, or not M, and Field B = null Date calculations. (display/enable fields only when a certain field is after a given date)

I'm thinking this can be achieved by binding to the change on the field and checking the other field values, before I do that is that the right approach?

seseso commented 5 years ago

I think you're in the right path. You can also have a look at the Observables: http://alpacajs.org/docs/api/observables.html

codek commented 5 years ago

Thanks, I'll look at that.