wiki.techinc.nl/includes/htmlform/HTMLHiddenField.php
Nemo bis cb47ea303c Update html5 specs link in comment
Change-Id: I415d11f1dfff92e44d29637e8a3a5fd408994c9a
2014-05-05 17:34:31 +02:00

40 lines
785 B
PHP

<?php
class HTMLHiddenField extends HTMLFormField {
public function __construct( $params ) {
parent::__construct( $params );
# Per HTML5 spec, hidden fields cannot be 'required'
# http://www.w3.org/TR/html5/forms.html#hidden-state-%28type=hidden%29
unset( $this->mParams['required'] );
}
public function getTableRow( $value ) {
$params = array();
if ( $this->mID ) {
$params['id'] = $this->mID;
}
$this->mParent->addHiddenField( $this->mName, $this->mDefault, $params );
return '';
}
/**
* @since 1.20
*/
public function getDiv( $value ) {
return $this->getTableRow( $value );
}
/**
* @since 1.20
*/
public function getRaw( $value ) {
return $this->getTableRow( $value );
}
public function getInputHTML( $value ) {
return '';
}
}