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

28 calls to form_hidden()
aggregator_form_category in modules/aggregator.module
aggregator_form_feed in modules/aggregator.module
comment_admin_edit in modules/comment.module
Menu callback; edit a comment from the administrative interface.
comment_render in modules/comment.module
fileupload_form in developer/examples/fileupload.module

... See full list

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";
}