Form Generation Library


Automation

The beauty of the Form Generation Library is that it helps you to automize stuff and prevents you from creating redundant code. Here are some features of the library that will help you to automate form generation:

Labels

Creating labels for your form elements is as easy as providing them with the element method. The library automatically sets the 'for' attribute for you to make sure that your users can bring it in focus by either clicking the mouse on the element or its label.

IDs

If you don't provide an ID for certain elements, don't worry! The library will automatically create unique random ID's for your elements and labels — if needed. That comes in handy when creating checkboxes or radio buttons with labels. Isn't that cool?

Name as ID

If you usually give your elements the same name and ID there's something for you. Simply set '$config['nameasid'] = TRUE' in the config file and all your elements will automatically receive the same name and ID value. Oh and in case you want a different name and ID for some elements, that is not a problem either.

Validation

The Form Generation Library utilizes CodeIgniter's built in Form Validation Class. This means you can use custom callback functions and CodeIgniter's validation rules. More on this in Validation.

Maxlength

If you add either 'max_length[20]' or 'exact_length[20]' to your element rule, a 'maxlength="20"' attribute will automatically be added to your element.