Fieldset
Fieldsets provide a good way to seperate sections of you forms. Goodform provides methods to open and close your fieldsets.
If you open a new fieldset without closing the previous fieldset, goodform will automatically close it for you!
There are two ways to call the open_field() method.
open_fieldset (string legend)
- legend: defines the legend of this field set | optional
Example:
$this->goodform->open_fieldset('My Profile');
Will produce the following HTML:
<fieldset>
<legend>Stuff</legend>
open_fieldset (array attributes)
- legend: defines attributes of the field set. Can also include a 'legend' attribute | optional
All attributes in this array will be converted to HTML element attributes. GoodForm will not check if these attributes are HTML valid. The only exceptions to this are the Special attributes that are not passed to the elements attribute string.
Example:
$attr = array(
'class' => 'my-fieldset-class',
'legend' => 'Stuff'
);
$this->goodform->open_fieldset($attr);
Will produce the following HTML:
<fieldset class="my-fieldset-class">
<legend>Stuff</legend>
close_fieldset ()
Example:
$this->goodform->close_fieldset();
Will produce the following HTML:
</fieldset>