I want to know if there exist a form generator that is capable of generating forms, mark validator(s) for element and whole form (or some like that) and been able to generate a json object and be 开发者_StackOverflowfilled with a json object.
If possible without any external large dependencies (like crafted by hand).
For clarification: the form should be made in client side javascript from an json object if possible.
If you're okay with using PHP, then I would highly recommend php-form-builder-class. I'm not exactly sure what you mean by "external dependencies", but pfbc is pretty lightweight.
I had this very same question, and after some research, I ended up writing outperform myself. It's a small javascript form generator library that I recently wrote to support my own projects because I got fed up by the fact that all the form generators that I looked at either had a ton of dependencies, or were distinctly larger than my single page web-application.
I mean, let's face it: if my SPA is like 20KB unminified but gzipped, then I expect library routines which do something simple as generating a form to be significantly smaller. Its main features would be:
- Zero dependencies.
- Less filling (unminified but gzipped: <2KB).
- Native HTML5/browser validation support for all HTML5+ input types.
- Custom validation seemlessly integrated.
- Supports all web frameworks out there (including Bootstrap).
- Autorefills half-filled forms when reloading a page in all browsers.
- JSON set/get for all form values.
I have discovered Outperform described by BuGless and it looks great, perfect for simple forms and NO DEPENDENCIES. Thank you ! Now, I could use some examples of how it is being used in some real world use cases, if possible, as your documentation is a little bit sparse for a newbie like me. Is there any chance if you read this that you can post some links to documentation or examples ? Thanks very much.
精彩评论