The ClearOS framework uses the standard functions from the CodeIgniter Form Helper for handling form open/close along with form fieldsets:
Function | Purpose |
---|---|
form_open(url, attributes = NULL) | Creating the opening <form> HTML element |
form_close() | Creating the closing </form> HTML element |
The URL to post form button actions.
Optional HTML attributes to be passed to the button. We do not want to encourage using the options array, so please send us a quick note about why you need it.
echo form_open('date'); echo form_fieldset(lang('date_time_and_date')); // some form fields and buttons go here echo form_fieldset_close(); echo form_close();
Fieldsets are used to group various form fields together. For example, the user edit page has a fieldset for the address information, and a different fieldset for the various phone numbers. The purpose
Function | Purpose |
---|---|
form_fieldset(legend, attributes = NULL) | Generating <fieldset> element with given <legend> |
form_fieldset_close() | Creating the closing </fieldset> HTML element |
echo form_fieldset(lang('user_address')); // some address form fields echo form_fieldset_close(); echo form_fieldset(lang('user_telephone')); // some phone number form fields (work, mobile, home, yacht) echo form_fieldset_close();
The above example would generate the following HTML.
<fieldset> <legend>Address</legend> <!-- some address fields --> </fieldset> <fieldset> <legend>Telephone</legend> <!-- some phone fields --> </fieldset>