Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
de79420b
Commit
de79420b
authored
Dec 23, 2007
by
Gábor Hojtsy
Browse files
#195176
by chx: form_set_error doxygen was misleading
parent
ac4c8f7a
Changes
1
Hide whitespace changes
Inline
Side-by-side
includes/form.inc
View file @
de79420b
...
...
@@ -739,9 +739,18 @@ function form_execute_handlers($type, &$form, &$form_state) {
}
/**
* File an error against a form element. If the name of the element is
* edit[foo][bar] then you may pass either foo or foo][bar as $name
* foo will set an error for all its children.
* File an error against a form element.
*
* @param $name
* The name of the form element. If the #parents property of your form
* element is array('foo', 'bar', 'baz') then you may set an error on 'foo'
* or 'foo][bar][baz'. Setting an error on 'foo' sets an error for every
* element where the #parents array starts with 'foo'.
* @param $message
* The error message to present to the user.
* @return
* Never use the return value of this function, use form_get_errors and
* form_get_error instead.
*/
function
form_set_error
(
$name
=
NULL
,
$message
=
''
)
{
static
$form
=
array
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment