/** * FormHandler::hiddenField() * * Create a hidden field * * @param string $name: The name of the field * @param string $value: The value of the field * @param string $validator: The validator which should be used to validate the value of the field * @param string $extra: CSS, Javascript or other which are inserted into the HTML tag * @return void * @access public * @author Teye Heimans */ function hiddenField($name, $value = null, $validator = null, $extra = null) { require_once FH_INCLUDE_DIR . 'fields/class.HiddenField.php'; // create new hidden field $fld = new HiddenField($this, $name); // only set the hidden field value if there is not a value in the $_POST array if (!is_null($value) && !$this->isPosted()) { $fld->setValue($value); } if (!empty($validator)) { $fld->setValidator($validator); } if (!empty($extra)) { $fld->setExtra($extra); } // register the field $this->_registerField($name, $fld, '__HIDDEN__'); }