apex:inputHidden

An HTML input element of type hidden, that is, an input element that is invisible to the user. Use this component to pass variables from page to page.

Use this component to get user input for a controller method that does not correspond to a field on an sObject. Only <apex:inputField> and <apex:outputField> can be used with sObject fields.

This component supports HTML pass-through attributes using the “html-” prefix. Pass-through attributes are attached to the generated <input> tag.

Example 

1<apex:inputHidden value="{!inputValue}" id="theHiddenInput"/>

The example renders the following HTML:

1<input id="theHiddenInput" type="hidden" name="theHiddenInput" />

Attributes 

Attribute NameAttribute TypeDescriptionRequired?API VersionAccess
idStringAn identifier that allows the inputHidden component to be referenced by other components in the page. 10.0global
immediateBooleanA Boolean value that specifies whether the action associated with this component should happen immediately, without processing any validation rules associated with the fields on the page. If set to true, the action happens immediately and validation rules are skipped. If not specified, this value defaults to false. See Use the immediate Attribute Carefully. 11.0global
renderedBooleanA Boolean value that specifies whether the component is rendered on the page. If not specified, this value defaults to true. 10.0global
requiredBooleanA Boolean value that specifies whether this inputHidden field is a required field. If set to true, the a value must be specified for this field. If not selected, this value defaults to false. 10.0global
valueObjectA merge field that references the controller class variable that is associated with this hidden input field. For example, if the name of the associated variable in the controller class is myHiddenVariable, use value=”{!myHiddenVariable}” to reference the variable. 10.0global

See Also