Part of the EllisLab Network
   
1 of 68
1
Form Generation Library
Posted: 06 March 2009 12:43 PM   [ Ignore ]  
Lab Assistant
Avatar
RankRank
Total Posts:  253
Joined  06-23-2008

New version 2.0.1 available!
Please read the changelog before downloading and upgrading

Welcome to the home of the Form Generation Library, a project that will help you to accelerate your form creation and reduce your coding efforts.

The Form Generation Library is based on the idea of Benjamin Midget’s Midget Forms (which is no longer actively developed) and is maintained and developed by Frank Michel. I am always looking forward to code improvements or bug reports, so if you find anything please let me know [info at frankmichel dot com]! I’d love to include it in the next release.

The library is generating valid XHTML and utilizes CI’s form validation including the support of custom callback functions. Take a look at the demo form.

I have developed a user guide that gives you some help in understanding how the library works.

If you download the files you will also find lots of comments that will explain how to use the library and its methods. You can choose between two download options (with or without user guide).

Please see the user guide for installation guidelines.

The user guide also provides important information about the config file and usage of the various form elements.

Last, but not least please take a look at the release notes to keep up with the latest updates and changes.

I hope you enjoy the library and help to make it even better. If you’re using it for commercial projects I would appreciate a small donation. As a thank you please grab one of the Form Generation Library Quick Reference guides.

Cheers,
Frank

IMPORTANT:
Verson 2.0 requires CodeIgniter > 2.0.0

Verson 1.0 includes major udpates and changed syntax in various places. Please read the upgrade instructions on the download page.

Version 0.1.5 changes the way the config file is set-up. Please read the user guide and change your existing config files to match the new standard.

 Signature 

Tired of forms? Check out Form Generation Library

Profile
 
 
Posted: 06 March 2009 01:05 PM   [ Ignore ]   [ # 1 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  281
Joined  02-12-2009

I’m very interested in this, please keep us (or me) posted.

 Signature 

.htaccess mod_rewrite no longer working when moving from the development server to production server?

Check that you have AllowOverride All in your host config file for the public web directory of your website.

AND USE THE FRACKING SEARCH!!!  it works, it really does!

Profile
 
 
Posted: 06 March 2009 01:29 PM   [ Ignore ]   [ # 2 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  297
Joined  05-29-2006

Wow!!!! i’m very interest also

 Signature 

CI Js_calendar plugin click

WYSIWYG with CI

Profile
 
 
Posted: 06 March 2009 01:41 PM   [ Ignore ]   [ # 3 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  466
Joined  01-17-2008

Post the PHP file or its not true!!! haha jk but i would be happy to test it out for you and give feedback.

 Signature 

aka trs21219
CodeSanity | Github | LinkedIn | Facebook | Twitter | Last.fm

Profile
 
 
Posted: 06 March 2009 02:18 PM   [ Ignore ]   [ # 4 ]  
Grad Student
Avatar
Rank
Total Posts:  69
Joined  02-26-2009

I only hope it’s true, I’ll kiss the ground you walk for this one!

Profile
 
 
Posted: 06 March 2009 08:01 PM   [ Ignore ]   [ # 5 ]  
Sr. Research Associate
Avatar
RankRankRankRankRank
Total Posts:  2771
Joined  07-27-2006

Been wanting to do this myself for some time now. There are other versions out there, but I’ll be interested to see what you’ve done.

 Signature 

Check out the Template Library
Oh yeah, I tweet, too (regarding CodeIgniter on occassion).

Profile
 
 
Posted: 07 March 2009 02:08 PM   [ Ignore ]   [ # 6 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  253
Joined  06-23-2008

I knew this one would draw attention smile But the good news is that it really is true and I am working hard to release it asap. The inspiration came from Benjamin Midget’s MidgetForms which was a great approach but unfortunately never got to version 1.0. Since i needed form generation asap i decided to build a library myself.

I added error handling today so the script auto validates the code and checks for correct syntax when adding elements to the form.

As a sneak peek these are the element methods which will be available in the library:

->fieldset(STR legend [, ARR|STR attributes])
->hidden(STR name|id [, STR value])
->label(STR label, STR for [, ARR|STR attributes])
->text(STR name|id [, STR label, STR rules, STR value, ARR|STR attributes])
->password(STR name|id [, STR label , STR rules, STR value, ARR|STR attributes])
->textarea(STR name|id [, STR label, STR rules, STR value, ARR|STR attributes])
->upload(STR name|id [, STR label, BOOL required, ARR|STR attributes])
->iupload()
->select(STR name|id, ARR options [, STR label, ARR|STR selected, STR rules, ARR|STR attributes])
->checkbox(STR name|id, STR value [, STR label, BOOL checked, STR rules, ARR|STR attributes])
->checkgroup(STR name, ARR checks [, ARR|STR checked, STR rules, ARR|STR attributes])
->radiogroup(STR name, ARR radios [, ARR|STR checked, STR rules, ARR|STR attributes])
->button(STR content [, STR name|id, STR type, ARR|STR attributes])
->image(STR src [, STR name|id, ARR|STR attributes])
->submit([STR value, STR name|id, ARR|STR attributes])
->reset([STR value, STR name|id, ARR|STR attributes])
->span(STR content [, ARR|STR attributes])
->html(STR content)
->br()
->hr()
->space()

To add an element id you can pipe the name parameter like “elname|elid” where the id is an optional parameter. If an id is mandatory (such as for a label’s for attribute) and you didn’t specify it the library will automatically generate a unique id for you.

Moreover there will be lots of methods to add classes, rules, errors, attributes, etc.

I’ll keep you all posted!

 Signature 

Tired of forms? Check out Form Generation Library

Profile
 
 
Posted: 07 March 2009 04:41 PM   [ Ignore ]   [ # 7 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  281
Joined  02-12-2009

any info on doctype?  will it support both html and xhtml? 

what about the form tag attribs?  name, id, action, enctype, etc?

 Signature 

.htaccess mod_rewrite no longer working when moving from the development server to production server?

Check that you have AllowOverride All in your host config file for the public web directory of your website.

AND USE THE FRACKING SEARCH!!!  it works, it really does!

Profile
 
 
Posted: 07 March 2009 05:51 PM   [ Ignore ]   [ # 8 ]  
Grad Student
Avatar
Rank
Total Posts:  69
Joined  02-26-2009

I want to see some example of usage wink

macigniter - 07 March 2009 07:08 PM

I knew this one would draw attention smile But the good news is that it really is true and I am working hard to release it asap. The inspiration came from Benjamin Midget’s MidgetForms which was a great approach but unfortunately never got to version 1.0. Since i needed form generation asap i decided to build a library myself.

I added error handling today so the script auto validates the code and checks for correct syntax when adding elements to the form.

As a sneak peek these are the element methods which will be available in the library:

->fieldset(STR legend [, ARR|STR attributes])
->hidden(STR name|id [, STR value])
->label(STR label, STR for [, ARR|STR attributes])
->text(STR name|id [, STR label, STR rules, STR value, ARR|STR attributes])
->password(STR name|id [, STR label , STR rules, STR value, ARR|STR attributes])
->textarea(STR name|id [, STR label, STR rules, STR value, ARR|STR attributes])
->upload(STR name|id [, STR label, BOOL required, ARR|STR attributes])
->iupload()
->select(STR name|id, ARR options [, STR label, ARR|STR selected, STR rules, ARR|STR attributes])
->checkbox(STR name|id, STR value [, STR label, BOOL checked, STR rules, ARR|STR attributes])
->checkgroup(STR name, ARR checks [, ARR|STR checked, STR rules, ARR|STR attributes])
->radiogroup(STR name, ARR radios [, ARR|STR checked, STR rules, ARR|STR attributes])
->button(STR content [, STR name|id, STR type, ARR|STR attributes])
->image(STR src [, STR name|id, ARR|STR attributes])
->submit([STR value, STR name|id, ARR|STR attributes])
->reset([STR value, STR name|id, ARR|STR attributes])
->span(STR content [, ARR|STR attributes])
->html(STR content)
->br()
->hr()
->space()

To add an element id you can pipe the name parameter like “elname|elid” where the id is an optional parameter. If an id is mandatory (such as for a label’s for attribute) and you didn’t specify it the library will automatically generate a unique id for you.

Moreover there will be lots of methods to add classes, rules, errors, attributes, etc.

I’ll keep you all posted!

Profile
 
 
Posted: 07 March 2009 07:43 PM   [ Ignore ]   [ # 9 ]  
Grad Student
Rank
Total Posts:  56
Joined  09-12-2008

This seems very interesting, looking forward to it.

 Signature 

Personal Site | Twitter

Profile
 
 
Posted: 08 March 2009 12:25 AM   [ Ignore ]   [ # 10 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  549
Joined  07-28-2008

Very cool. One of these days I need to get around to doing this for myself, as I invision validation / form configuration working seemlessly together. This is what I am looking to do:

$fields = array(
                array(
'type'         => 'input',
                      
'name'         => 'test',
                      
'id'             => 'test',
                      
'label'         => 'Test Input:',
                      
'class'         => 'field',
                      
'attr'        => '',
                      
'default'     => 'Default Value',
                      
'max_length'     => '50',// If set, will also set validation rule automatically to max_length
                      
'rules'        => 'required|callback__validateTest'),
                
                array(
'type'         => 'select',
                      
'name'         => 'test2',
                      
'id'             => 'test2',
                      
'label'         => 'Test Select 2:',
                      
'class'         => 'select',
                      
'attr'        => '',
                      
'default'     => '0',
                      
'lookups'     => array('0' => 'value 1''1' => 'value 2'),// form validation will now check for what has been posted and verify it is in this array key
                      
'rules'        => 'required|callback__validateTest'),                      
            );
$form create_form('form_name''action''id="bob"|style="width:234px;"'$fields); 

That’s my dream anyways. Views would pretty much be obsolete as they are all configured in the controller. Just the standard view_form view could be called.

I really should get crackin on this eh?

 Signature 

~ 4 All the Right Reasons ~

Profile
 
 
   
1 of 68
1