form_hidden

Definition

form_hidden($name, $value)
drupal/includes/common.inc, line 1373

Description

Store data in a hidden form field.

This function can be useful in retaining information between page requests, but be sure to validate the data on the receiving page as it is possible for an attacker to change the value before it is submitted.

Parameters

$name The internal name used to refer to the field.

$value The stored data.

Return value

A themed HTML string representing the hidden field.

Related topics

Namesort iconDescription
Form generationFunctions to enable output of HTML forms and form elements.
Input validationFunctions to validate user input.

Code

function form_hidden($name, $value) {
  return '<input type="hidden" name="edit['. $name .']" value="'. check_plain($value) ."\" />\n";
}