Hacker News new | ask | show | jobs
by antjanus 4466 days ago
Awesome. I usually don't see anyone understanding the necessity of dynamic form building.

In this case, you could easily get a form declaration from a database or another file, go through your controller (or form builder class) to translate it and add the correct parameters.

For those that don't get why you'd need to do that, here are some examples:

* creating forms in multiple languages (the form controller can take care of content/labeling/placeholders) * creating forms to comply in multiple countries (for example, the same sign up form in Europe may require a "accept cookies when I'm on site" checkbox or something similar). * creating forms based on preselected options. For instance, if a user is signing up for a free account, they won't need to give their name. While a paid account (by necessity of billing) will require credit card info.

Really cool :)