Why does the form have to be generated dynamically by JS?<p>A much better solution would be to generate the markup on the server-side. It should be easy enough to port this to Node, and a bit more of work for other major backend languages like Ruby, Python and PHP.<p>It could even be implemented as a webapp that takes the input JSON on the left side, and spits out HTML on the right, which I could paste into my site markup directly.<p>Right now, the trade-off is too big for the developer-time convenience of generating forms dynamically.
At a first glance: very cool plugin, I think the core idea of representing forms as JSON is a good one. Two gentle criticisms:<p>1. From a 'prospective developer' standpoint, I'm worried about the dependencies and general heft of the thing. Does it require jQuery UI? Is there a stripped-down version I can use? As far as I can tell, the landing page doesn't answer these questions.<p>2. More broadly, I'd argue that there are two types of <form> implementations: barebones forms that use 'value' and 'type' and very little else, and hyper-customized ones that are generated bespoke. This plugin seems to address the middle of that spectrum: people who need a little -- but not too much -- customization. It's hard to tell exactly what options I'm given just from poking through the first few pages.
I'm worried this does not put usability first. In the example Edit form, I noticed two problems: 1) the radio button labels have not been linked using 'for' to the buttons, so clicking on them does nothing. 2) Hovering my mouse over the first address line text box causes it to move down away from my mouse! Errors like these will cause a lot of entry mistakes.
This is really just an awful idea. Every few weeks/months I see some kind of "wouldn't it be great to have users write pseudo-html in json and we can then write loads of javascript to write the html for them!" kind of library and the answer to that is always "why would that have ever seemed like a good idea?".<p>Good libraries decorate html to provide functionality because, well html is pretty good at the html bit.
Before having a big complain about the radio buttons, why not see:<p><a href="https://github.com/1337/alpaca/commit/d15032dd14214786f695252dddf4ddee499faadf" rel="nofollow">https://github.com/1337/alpaca/commit/d15032dd14214786f69525...</a><p>It literally would have taken a similar amount of time to fix vs complain :/, and much less to just open the issues list.
The first example renders a form with radio button labels not tied to the appropriate controls, so I can't just click them to select the radio button. Same for the other labels. This is <i>totally unforgivable</i> and such a well known annoyance that I refuse to read anything else. RIP Alpaca.
Love it! The complaints here are usually from people who assume this is good for all situations. If you have a fixed amount of static forms, this wouldn't make sense. BUT, if you had to do dynamic forms that can change drastically with user input, this is wonderful.
During my University coursework this year I had the same idea during one of my assignments, I wrote something similar without using jQuery as a hack for a entry level web development paper.
No labels at all just on the demo form. This isn't 1996 where one can make shitty HTML forms for shits and giggles. People expect high quality forms with labels nowadays.<p>As others have said: dealbreaker. Not going to use it.