form_hidden

Store data in a hidden form field.

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.

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.

Related topics

34 calls to form_hidden()

File

includes/common.inc, line 1373
Common functions that many Drupal modules will need to reference.

Code

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