form_fieldset()

form_fieldset([$legend_text = ''[, $attributes = array()]])

Parameters:
  • $legend_text (string) – Text to put in the <legend> tag
  • $attributes (array) – Attributes to be set on the <fieldset> tag
Returns:

An HTML fieldset opening tag

Return type:

string

Lets you generate fieldset/legend fields.

Example:

echo form_fieldset('Address Information');
echo "<p>fieldset content here</p>\n";
echo form_fieldset_close();

/*
        Produces:

                <fieldset>
                        <legend>Address Information</legend>
                                <p>form content here</p>
                </fieldset>
*/

Similar to other functions, you can submit an associative array in the second parameter if you prefer to set additional attributes:

$attributes = array(
        'id'    => 'address_info',
        'class' => 'address_info'
);

echo form_fieldset('Address Information', $attributes);
echo "<p>fieldset content here</p>\n";
echo form_fieldset_close();

/*
        Produces:

        <fieldset id="address_info" class="address_info">
                <legend>Address Information</legend>
                <p>form content here</p>
        </fieldset>
*/
doc_CodeIgniter
2016-10-15 16:32:19
Comments
Leave a Comment

Please login to continue.