There are tons of ways to handle forms in general, but I'm wondering if anyone has a solid solution that they use for almost all of their apps, something can build out forms quickly and include all types of form elements.
What I'm currently using is simply CI's built-in form validation and then building out a form, but even with this, I feel like it takes too long... any suggestions?
There is a jQuery plugin (called "dform") which take JSON input to build a form dynamically. I have been using this for a while now.
Please take a look at the following URL:
http://neyeon.com/p/jquery.dform/doc/files2/readme-txt.html
Quick Usage:
var formdata =
{
"action" : "index.html",
"method" : "get",
"elements" :
[
{
"name" : "textfield",
"label" : "Label for textfield",
"type" : "text",
"value" : "Hello world"
},
{
"type" : "submit",
"value" : "Submit"
}
]
};
$("#myform").buildForm(formdata);
// Or to load the form definition via AJAX
$("#myform").buildForm("http://example.com/myform.json");
https://github.com/zwacky/codeigniter_form_builder - is a form builder library for codeigniter. it has an extensive how to page and should be easy to use.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With