Developers Documentation

×

Warning

301 error for file:https://clearos.com/dokuwiki2/lib/exe/css.php?t=dokuwiki&tseed=82873f9c9a1f5784b951644363f20ef8

User Tools

Site Tools


Forms

The ClearOS framework uses the standard functions from the CodeIgniter Form Helper for handling form open/close along with form fieldsets:

  • form_open
  • form_close
  • form_fieldset
  • form_fieldset_close

Form Open/Close

Functions

FunctionPurpose
form_open(url, attributes = NULL)Creating the opening
HTML element
form_close()Creating the closing HTML element

Parameters

url

The URL to post form button actions.

attributes (optional)

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.

Example

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

Functions

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

FunctionPurpose
form_fieldset(legend, attributes = NULL)Generating
element with given
form_fieldset_close()Creating the closing HTML element

Example

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> 

</fieldset>
 
<fieldset>
<legend>Telephone</legend> 

</fieldset>
content/en_us/dev_framework_reference_guide_forms.txt · Last modified: 2015/02/05 19:47 (external edit)

https://clearos.com/dokuwiki2/lib/exe/indexer.php?id=content%3Aen_us%3Adev_framework_reference_guide_forms&1710840220