summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/helpers/form_helper.rst
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-11-08 16:27:57 +0100
committerAndrey Andreev <narf@bofh.bg>2012-11-08 16:27:57 +0100
commitf6d9a7cff222f868312a6d4ae4e4050616acb9a7 (patch)
treee91c1ff1165e12102a0ed068e99c555bff6db8e5 /user_guide_src/source/helpers/form_helper.rst
parent48a8675c3a50beba5a22080ea11050287b5866bb (diff)
Polish docs for the File and Form helpers
Diffstat (limited to 'user_guide_src/source/helpers/form_helper.rst')
-rw-r--r--user_guide_src/source/helpers/form_helper.rst494
1 files changed, 335 insertions, 159 deletions
diff --git a/user_guide_src/source/helpers/form_helper.rst b/user_guide_src/source/helpers/form_helper.rst
index 02a758694..b2a9b6f0f 100644
--- a/user_guide_src/source/helpers/form_helper.rst
+++ b/user_guide_src/source/helpers/form_helper.rst
@@ -10,9 +10,7 @@ forms.
Loading this Helper
===================
-This helper is loaded using the following code
-
-::
+This helper is loaded using the following code::
$this->load->helper('form');
@@ -21,19 +19,27 @@ The following functions are available:
form_open()
===========
-Creates an opening form tag with a base URL **built from your config preferences**. It will optionally let you add form attributes and hidden input fields, and will always add the attribute accept-charset based on the charset value in your config file.
+.. php:function:: form_open($action = '', $attributes = '', $hidden = array())
-The main benefit of using this tag rather than hard coding your own HTML is that it permits your site to be more portable in the event your URLs ever change.
+ :param string $action: Form action/target URI string
+ :param string $attributes: HTML attributes
+ :param array $hidden: An array of hidden fields' definitions
+ :returns: string
-Here's a simple example
+Creates an opening form tag with a base URL **built from your config preferences**.
+It will optionally let you add form attributes and hidden input fields, and
+will always add the `accept-charset` attribute based on the charset value in your
+config file.
-::
+The main benefit of using this tag rather than hard coding your own HTML is that
+it permits your site to be more portable in the event your URLs ever change.
+
+Here's a simple example::
echo form_open('email/send');
-The above example would create a form that points to your base URL plus the "email/send" URI segments, like this
-
-::
+The above example would create a form that points to your base URL plus the
+"email/send" URI segments, like this::
<form method="post" accept-charset="utf-8" action="http://example.com/index.php/email/send" />
@@ -41,32 +47,25 @@ Adding Attributes
^^^^^^^^^^^^^^^^^
Attributes can be added by passing an associative array to the second
-parameter, like this
-
-::
+parameter, like this::
$attributes = array('class' => 'email', 'id' => 'myform');
echo form_open('email/send', $attributes);
-The above example would create a form similar to this
-
-::
+The above example would create a form similar to this::
<form method="post" accept-charset="utf-8" action="http://example.com/index.php/email/send" class="email" id="myform" />
Adding Hidden Input Fields
^^^^^^^^^^^^^^^^^^^^^^^^^^
-Hidden fields can be added by passing an associative array to the third parameter, like this
-
-::
+Hidden fields can be added by passing an associative array to the
+third parameter, like this::
- $hidden = array('username' => 'Joe', 'member_id' => '234');
+ $hidden = array('username' => 'Joe', 'member_id' => '234');
echo form_open('email/send', '', $hidden);
-The above example would create a form similar to this
-
-::
+The above example would create a form similar to this::
<form method="post" accept-charset="utf-8" action="http://example.com/index.php/email/send">
<input type="hidden" name="username" value="Joe" />
@@ -75,29 +74,38 @@ The above example would create a form similar to this
form_open_multipart()
=====================
-This function is absolutely identical to the `form_open()` tag above
-except that it adds a multipart attribute, which is necessary if you
+.. php:function:: form_open_multipart($action = '', $attributes = array(), $hidden = array())
+
+ :param string $action: Form action/target URI string
+ :param string $attributes: HTML attributes
+ :param array $hidden: An array of hidden fields' definitions
+ :returns: string
+
+This function is absolutely identical to :php:func:`form_open()` above,
+except that it adds a *multipart* attribute, which is necessary if you
would like to use the form to upload files with.
form_hidden()
=============
-Lets you generate hidden input fields. You can either submit a
-name/value string to create one field
+.. php:function:: form_hidden($name, $value = '')
-::
+ :param string $name: Field name
+ :param string $value: Field value
+ :returns: string
+
+Lets you generate hidden input fields. You can either submit a
+name/value string to create one field::
form_hidden('username', 'johndoe');
// Would produce: <input type="hidden" name="username" value="johndoe" />
-Or you can submit an associative array to create multiple fields
-
-::
+... or you can submit an associative array to create multiple fields::
$data = array(
- 'name'  => 'John Doe',
- 'email' => 'john@example.com',
- 'url'   => 'http://example.com'
+ 'name' => 'John Doe',
+ 'email' => 'john@example.com',
+ 'url' => 'http://example.com'
);
echo form_hidden($data);
@@ -109,35 +117,32 @@ Or you can submit an associative array to create multiple fields
<input type="hidden" name="url" value="http://example.com" />
*/
-Or pass an associative array to the value field.
-
-::
+You can also pass an associative array to the value field::
$data = array(
- 'name'  => 'John Doe',
- 'email' => 'john@example.com',
- 'url'   => 'http://example.com'
+ 'name' => 'John Doe',
+ 'email' => 'john@example.com',
+ 'url' => 'http://example.com'
);
echo form_hidden('my_array', $data);
/*
Would produce:
+
<input type="hidden" name="my_array[name]" value="John Doe" />
<input type="hidden" name="my_array[email]" value="john@example.com" />
<input type="hidden" name="my_array[url]" value="http://example.com" />
*/
-If you want to create hidden input fields with extra attributes
-
-::
+If you want to create hidden input fields with extra attributes::
$data = array(
- 'type'        => 'hidden',
- 'name'        => 'email',
- 'id'          => 'hiddenemail',
- 'value'       => 'john@example.com',
- 'class'       => 'hiddenemail'
+ 'type' => 'hidden',
+ 'name' => 'email',
+ 'id' => 'hiddenemail',
+ 'value' => 'john@example.com',
+ 'class' => 'hiddenemail'
);
echo form_input($data);
@@ -151,25 +156,28 @@ If you want to create hidden input fields with extra attributes
form_input()
============
-Lets you generate a standard text input field. You can minimally pass
-the field name and value in the first and second parameter
+.. php:function:: form_input($data = '', $value = '', $extra = '')
-::
+ :param array $data: Field attributes data
+ :param string $value: Field value
+ :param string $extra: Extra attributes to be added to the tag *as is*
+ :returns: string
+
+Lets you generate a standard text input field. You can minimally pass
+the field name and value in the first and second parameter::
echo form_input('username', 'johndoe');
Or you can pass an associative array containing any data you wish your
-form to contain
-
-::
+form to contain::
$data = array(
- 'name'        => 'username',
- 'id'          => 'username',
- 'value'       => 'johndoe',
- 'maxlength'   => '100',
- 'size'        => '50',
- 'style'       => 'width:50%'
+ 'name' => 'username',
+ 'id' => 'username',
+ 'value' => 'johndoe',
+ 'maxlength' => '100',
+ 'size' => '50',
+ 'style' => 'width:50%'
);
echo form_input($data);
@@ -181,9 +189,7 @@ form to contain
*/
If you would like your form to contain some additional data, like
-Javascript, you can pass it as a string in the third parameter
-
-::
+JavaScript, you can pass it as a string in the third parameter::
$js = 'onClick="some_function()"';
echo form_input('username', 'johndoe', $js);
@@ -191,34 +197,70 @@ Javascript, you can pass it as a string in the third parameter
form_password()
===============
-This function is identical in all respects to the `form_input()` function above except that it uses the "password" input type.
+.. php:function:: form_password($data = '', $value = '', $extra = '')
+
+ :param array $data: Field attributes data
+ :param string $value: Field value
+ :param string $extra: Extra attributes to be added to the tag *as is*
+ :returns: string
+
+This function is identical in all respects to the :php:func:`form_input()`
+function above except that it uses the "password" input type.
form_upload()
=============
-This function is identical in all respects to the `form_input()` function above except that it uses the "file" input type, allowing it to be used to upload files.
+.. php:function:: form_upload($data = '', $value = '', $extra = '')
+
+ :param array $data: Field attributes data
+ :param string $value: Field value
+ :param string $extra: Extra attributes to be added to the tag *as is*
+ :returns: string
+
+This function is identical in all respects to the :php:func:`form_input()`
+function above except that it uses the "file" input type, allowing it to
+be used to upload files.
form_textarea()
===============
-This function is identical in all respects to the `form_input()` function above except that it generates a "textarea" type. Note: Instead of the "maxlength" and "size" attributes in the above example, you will instead specify "rows" and "cols".
+.. php:function:: form_textarea($data = '', $value = '', $extra = '')
+
+ :param array $data: Field attributes data
+ :param string $value: Field value
+ :param string $extra: Extra attributes to be added to the tag *as is*
+ :returns: string
+
+This function is identical in all respects to the :php:func:`form_input()`
+function above except that it generates a "textarea" type.
+
+.. note: Instead of the *maxlength* and *size* attributes in the above example,
+ you will instead specify *rows* and *cols*.
form_dropdown()
===============
+.. php:function:: form_dropdown($name = '', $options = array(), $selected = array(), $extra = '')
+
+ :param string $name: Field name
+ :param array $options: An associative array of options to be listed
+ :param array $selected: List of fields to mark with the *selected* attribute
+ :param string $extra: Extra attributes to be added to the tag *as is*
+ :returns: string
+
Lets you create a standard drop-down field. The first parameter will
contain the name of the field, the second parameter will contain an
associative array of options, and the third parameter will contain the
value you wish to be selected. You can also pass an array of multiple
items through the third parameter, and CodeIgniter will create a
-multiple select for you. Example
+multiple select for you.
-::
+Example::
$options = array(
- 'small'  => 'Small Shirt',
- 'med'    => 'Medium Shirt',
- 'large'   => 'Large Shirt',
+ 'small' => 'Small Shirt',
+ 'med' => 'Medium Shirt',
+ 'large' => 'Large Shirt',
'xlarge' => 'Extra Large Shirt',
);
@@ -251,33 +293,47 @@ multiple select for you. Example
If you would like the opening <select> to contain additional data, like
an id attribute or JavaScript, you can pass it as a string in the fourth
-parameter
-
-::
+parameter::
$js = 'id="shirts" onChange="some_function();"';
echo form_dropdown('shirts', $options, 'large', $js);
-If the array passed as $options is a multidimensional array,
-`form_dropdown()` will produce an <optgroup> with the array key as the
+If the array passed as ``$options`` is a multidimensional array, then
+``form_dropdown()`` will produce an <optgroup> with the array key as the
label.
form_multiselect()
==================
+.. php:function:: form_multiselect($name = '', $options = array(), $selected = array(), $extra = '')
+
+ :param string $name: Field name
+ :param array $options: An associative array of options to be listed
+ :param array $selected: List of fields to mark with the *selected* attribute
+ :param string $extra: Extra attributes to be added to the tag *as is*
+ :returns: string
+
Lets you create a standard multiselect field. The first parameter will
contain the name of the field, the second parameter will contain an
associative array of options, and the third parameter will contain the
-value or values you wish to be selected. The parameter usage is
-identical to using form_dropdown() above, except of course that the
-name of the field will need to use POST array syntax, e.g. foo[].
+value or values you wish to be selected.
+
+The parameter usage is identical to using :php:func:`form_dropdown()` above,
+except of course that the name of the field will need to use POST array
+syntax, e.g. foo[].
form_fieldset()
-================
+===============
+
+.. php:function:: form_fieldset($legend_text = '', $attributes = array())
+
+ :param string $legend_text: Text to put in the <legend> tag
+ :param array $attributes: Attributes to be set on the <fieldset> tag
+ :returns: string
Lets you generate fieldset/legend fields.
-::
+Example::
echo form_fieldset('Address Information');
echo "<p>fieldset content here</p>\n";
@@ -285,6 +341,7 @@ Lets you generate fieldset/legend fields.
/*
Produces:
+
<fieldset>
<legend>Address Information</legend>
<p>form content here</p>
@@ -292,13 +349,11 @@ Lets you generate fieldset/legend fields.
*/
Similar to other functions, you can submit an associative array in the
-second parameter if you prefer to set additional attributes.
-
-::
+second parameter if you prefer to set additional attributes::
$attributes = array(
- 'id' => 'address_info',
- 'class' => 'address_info'
+ 'id' => 'address_info',
+ 'class' => 'address_info'
);
echo form_fieldset('Address Information', $attributes);
@@ -317,22 +372,33 @@ second parameter if you prefer to set additional attributes.
form_fieldset_close()
=====================
+.. php:function:: form_fieldset_close($extra = '')
+
+ :param string $extra: Anything to append after the closing tag, *as is*
+ :returns: string
+
Produces a closing </fieldset> tag. The only advantage to using this
function is it permits you to pass data to it which will be added below
the tag. For example
::
- $string = "</div></div>";
+ $string = '</div></div>';
echo form_fieldset_close($string);
// Would produce: </fieldset></div></div>
form_checkbox()
===============
-Lets you generate a checkbox field. Simple example
+.. php:function:: form_checkbox($data = '', $value = '', $checked = FALSE, $extra = '')
-::
+ :param array $data: Field attributes data
+ :param string $value: Field value
+ :param bool $checked: Whether to mark the checkbox as being *checked*
+ :param string $extra: Extra attributes to be added to the tag *as is*
+ :returns: string
+
+Lets you generate a checkbox field. Simple example::
echo form_checkbox('newsletter', 'accept', TRUE);
// Would produce: <input type="checkbox" name="newsletter" value="accept" checked="checked" />
@@ -346,21 +412,19 @@ array of attributes to the function
::
$data = array(
- 'name'        => 'newsletter',
- 'id'          => 'newsletter',
- 'value'       => 'accept',
- 'checked'     => TRUE,
- 'style'       => 'margin:10px',
+ 'name' => 'newsletter',
+ 'id'      => 'newsletter',
+ 'value'   => 'accept',
+ 'checked' => TRUE,
+ 'style'   => 'margin:10px'
);
echo form_checkbox($data);
// Would produce: <input type="checkbox" name="newsletter" id="newsletter" value="accept" checked="checked" style="margin:10px" />
-As with other functions, if you would like the tag to contain additional
-data, like JavaScript, you can pass it as a string in the fourth
-parameter
-
-::
+Also as with other functions, if you would like the tag to contain
+additional data like JavaScript, you can pass it as a string in the
+fourth parameter::
$js = 'onClick="some_function()"';
echo form_checkbox('newsletter', 'accept', TRUE, $js)
@@ -368,29 +432,28 @@ parameter
form_radio()
============
-This function is identical in all respects to the `form_checkbox()`
-function above except that it uses the "radio" input type.
-
-form_submit()
-=============
-
-Lets you generate a standard submit button. Simple example
+.. php:function:: form_radio($data = '', $value = '', $checked = FALSE, $extra = '')
-::
-
- echo form_submit('mysubmit', 'Submit Post!');
- // Would produce: <input type="submit" name="mysubmit" value="Submit Post!" />
+ :param array $data: Field attributes data
+ :param string $value: Field value
+ :param bool $checked: Whether to mark the radio button as being *checked*
+ :param string $extra: Extra attributes to be added to the tag *as is*
+ :returns: string
-Similar to other functions, you can submit an associative array in the
-first parameter if you prefer to set your own attributes. The third
-parameter lets you add extra data to your form, like JavaScript.
+This function is identical in all respects to the :php:func:`form_checkbox()`
+function above except that it uses the "radio" input type.
form_label()
============
-Lets you generate a <label>. Simple example
+.. php:function:: form_label($label_text = '', $id = '', $attributes = array())
-::
+ :param string $label_text: Text to put in the <label> tag
+ :param string $id: ID of the form element that we're making a label for
+ :param string $attributes: HTML attributes
+ :returns: string
+
+Lets you generate a <label>. Simple example::
echo form_label('What is your Name', 'username');
// Would produce: <label for="username">What is your Name</label>
@@ -398,7 +461,7 @@ Lets you generate a <label>. Simple example
Similar to other functions, you can submit an associative array in the
third parameter if you prefer to set additional attributes.
-::
+Example::
$attributes = array(
'class' => 'mycustomclass',
@@ -408,67 +471,103 @@ third parameter if you prefer to set additional attributes.
echo form_label('What is your Name', 'username', $attributes);
// Would produce: <label for="username" class="mycustomclass" style="color: #000;">What is your Name</label>
+form_submit()
+=============
+
+.. php:function:: form_submit($data = '', $value = '', $extra = '')
+
+ :param string $data: Button name
+ :param string $value: Button value
+ :param string $extra: Extra attributes to be added to the tag *as is*
+ :returns: string
+
+Lets you generate a standard submit button. Simple example::
+
+ echo form_submit('mysubmit', 'Submit Post!');
+ // Would produce: <input type="submit" name="mysubmit" value="Submit Post!" />
+
+Similar to other functions, you can submit an associative array in the
+first parameter if you prefer to set your own attributes. The third
+parameter lets you add extra data to your form, like JavaScript.
form_reset()
============
+.. php:function:: form_reset($data = '', $value = '', $extra = '')
+
+ :param string $data: Button name
+ :param string $value: Button value
+ :param string $extra: Extra attributes to be added to the tag *as is*
+ :returns: string
+
Lets you generate a standard reset button. Use is identical to
-`form_submit()`.
+:php:func:`form_submit()`.
form_button()
=============
-Lets you generate a standard button element. You can minimally pass the
-button name and content in the first and second parameter
+.. php:function:: form_button($data = '', $content = '', $extra = '')
-::
+ :param string $data: Button name
+ :param string $content: Button label
+ :param string $extra: Extra attributes to be added to the tag *as is*
+ :returns: string
- echo form_button('name','content');
- // Would produce <button name="name" type="button">Content</button>
+Lets you generate a standard button element. You can minimally pass the
+button name and content in the first and second parameter::
-Or you can pass an associative array containing any data you wish your
-form to contain:
+ echo form_button('name','content');
+ // Would produce: <button name="name" type="button">Content</button>
-::
+Or you can pass an associative array containing any data you wish your
+form to contain::
$data = array(
- 'name' => 'button',
- 'id' => 'button',
- 'value' => 'true',
- 'type' => 'reset',
- 'content' => 'Reset'
+ 'name' => 'button',
+ 'id' => 'button',
+ 'value' => 'true',
+ 'type' => 'reset',
+ 'content' => 'Reset'
);
echo form_button($data);
// Would produce: <button name="button" id="button" value="true" type="reset">Reset</button>
If you would like your form to contain some additional data, like
-JavaScript, you can pass it as a string in the third parameter:
+JavaScript, you can pass it as a string in the third parameter::
-::
-
- $js = 'onClick="some_function()"';
+ $js = 'onClick="some_function()"';
echo form_button('mybutton', 'Click Me', $js);
form_close()
============
+.. php:function:: form_close($extra = '')
+
+ :param string $extra: Anything to append after the closing tag, *as is*
+ :returns: string
+
Produces a closing </form> tag. The only advantage to using this
function is it permits you to pass data to it which will be added below
-the tag. For example
-
-::
+the tag. For example::
- $string = "</div></div>";
+ $string = '</div></div>';
echo form_close($string);
// Would produce: </form> </div></div>
form_prep()
===========
+.. php:function:: form_prep($str = '', $is_textarea = FALSE)
+
+ :param string $str: Value to escape
+ :param bool $is_textarea: Whether we're preparing for <textarea> or a regular input tag
+ :returns: string
+
Allows you to safely use HTML and characters such as quotes within form
-elements without breaking out of the form. Consider this example
-::
+elements without breaking out of the form.
+
+Consider this example::
$string = 'Here is a string containing "quoted" text.';
<input type="text" name="myform" value="$string" />
@@ -486,29 +585,42 @@ safely::
set_value()
===========
+.. php:function:: set_value($field = '', $default = '', $is_textarea = FALSE)
+
+ :param string $field: Field name
+ :param string $default: Default value
+ :param bool $is_textarea: Whether we're setting <textarea> content
+ :returns: string
+
Permits you to set the value of an input form or textarea. You must
supply the field name via the first parameter of the function. The
second (optional) parameter allows you to set a default value for the
-form. Example
+form.
-::
+Example::
- <input type="text" name="quantity" value="<?php echo set_value('quantity', '0'); ?>" size="50" />
+ <input type="text" name="quantity" value="<?=set_value('quantity', '0');?>" size="50" />
The above form will show "0" when loaded for the first time.
set_select()
============
+.. php:function:: set_select($field = '', $value = '', $default = FALSE)
+
+ :param string $field: Field name
+ :param string $value: Value to check for
+ :param string $default: Whether the value is also a default one
+ :returns: string
+
If you use a <select> menu, this function permits you to display the
-menu item that was selected. The first parameter must contain the name
-of the select menu, the second parameter must contain the value of each
-item, and the third (optional) parameter lets you set an item as the
-default (use boolean TRUE/FALSE).
+menu item that was selected.
-Example
+The first parameter must contain the name of the select menu, the second
+parameter must contain the value of each item, and the third (optional)
+parameter lets you set an item as the default (use boolean TRUE/FALSE).
-::
+Example::
<select name="myselect">
<option value="one" <?php echo set_select('myselect', 'one', TRUE); ?> >One</option>
@@ -519,12 +631,20 @@ Example
set_checkbox()
==============
-Permits you to display a checkbox in the state it was submitted. The
-first parameter must contain the name of the checkbox, the second
+.. php:function:: set_checkbox($field = '', $value = '', $default = FALSE)
+
+ :param string $field: Field name
+ :param string $value: Value to check for
+ :param string $default: Whether the value is also a default one
+ :returns: string
+
+Permits you to display a checkbox in the state it was submitted.
+
+The first parameter must contain the name of the checkbox, the second
parameter must contain its value, and the third (optional) parameter
-lets you set an item as the default (use boolean TRUE/FALSE). Example
+lets you set an item as the default (use boolean TRUE/FALSE).
-::
+Example::
<input type="checkbox" name="mycheck" value="1" <?php echo set_checkbox('mycheck', '1'); ?> />
<input type="checkbox" name="mycheck" value="2" <?php echo set_checkbox('mycheck', '2'); ?> />
@@ -532,15 +652,71 @@ lets you set an item as the default (use boolean TRUE/FALSE). Example
set_radio()
===========
+.. php:function:: set_radio($field = '', $value = '', $default = FALSE)
+
+ :param string $field: Field name
+ :param string $value: Value to check for
+ :param string $default: Whether the value is also a default one
+ :returns: string
+
Permits you to display radio buttons in the state they were submitted.
-This function is identical to the **set_checkbox()** function above.
+This function is identical to the :php:func:`set_checkbox()` function above.
-::
+Example::
<input type="radio" name="myradio" value="1" <?php echo set_radio('myradio', '1', TRUE); ?> />
<input type="radio" name="myradio" value="2" <?php echo set_radio('myradio', '2'); ?> />
-.. note:: If you are using the Form Validation class, you must always specify a rule for your field,
- even if empty, in order for the set_*() functions to work. This is because if a Form Validation object
- is defined, the control for set_*() is handed over to a method of the class instead of the generic helper
- function. \ No newline at end of file
+.. note:: If you are using the Form Validation class, you must always specify
+ a rule for your field, even if empty, in order for the ``set_*()``
+ functions to work. This is because if a Form Validation object is
+ defined, the control for ``set_*()`` is handed over to a method of the
+ class instead of the generic helper function.
+
+form_error()
+============
+
+.. php:function:: form_error($field = '', $prefix = '', $suffix = '')
+
+ :param string $field: Field name
+ :param string $prefix: Error opening tag
+ :param string $suffix: Error closing tag
+ :returns: string
+
+Returns a validation error message from the :doc:`Form Validation Library
+<../libraries/form_validation>`, associated with the specified field name.
+You can optionally specify opening and closing tag(s) to put around the error
+message.
+
+Example::
+
+ // Assuming that the 'username' field value was incorrect:
+ echo form_error('myfield', '<div class="error">', '</div>');
+
+ // Would produce: <div class="error">Error message associated with the "username" field.</div>
+
+validation_errors()
+===================
+
+.. php:function:: validation_errors($prefix = '', $suffix = '')
+
+ :param string $prefix: Error opening tag
+ :param string $suffix: Error closing tag
+ :returns: string
+
+Similarly to the :php:func:`form_error()` function, returns all validation
+error messages produced by the :doc:`Form Validation Library
+<../libraries/form_validation>`, with optional opening and closing tags
+around each of the messages.
+
+Example::
+
+ echo validation_errors('<span class="error">', '</span>');
+
+ /*
+ Would produce, e.g.:
+
+ <span class="error">The "email" field doesn't contain a valid e-mail address!</span>
+ <span class="error">The "password" field doesn't match the "repeat_password" field!</span>
+
+ */ \ No newline at end of file