form_error([$field = ''[, $prefix = ''[, $suffix = '']]])
Parameters: |
|
---|---|
Returns: |
HTML-formatted form validation error message(s) |
Return type: |
string |
Returns a validation error message from the Form Validation Library, 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>
Please login to continue.