Creates a new TFormDate element (multi-combobox based date field).
TFormDate
TFormDate
(string $name, string $displayname, string $class, bool $required, [array $yearrange = array(100,0)], [int $monthnames = null], [int $value = ""], [bool $store = true])
-
string
$name: The name of the element. This should correspond to the field names if using with TDBForm, and should not include any spaces or special characters.
-
string
$displayname: The name that should show up to the user for this field.
-
string
$class: The HTML Class to use for the element
-
bool
$required: True if the field has to be filled in
-
array
$yearrange: The range of years to display. This can be used two different ways: array(subtract,add), ie: array(100,0) specifies to show 100 years before the current year, up to the current year. The second way is to specify array("min"=>min,"max"=>max), ie: array("min"=>2000,"max"=>2010) will show from 2000 to 2010, regardless of the current year.
-
int
$monthnames: An array of all the names to use for the months, indexed starting at 1. If null, a default of the full English month name is used (ie "January", "September", etc)
-
int
$value: The initial value for the field. Note if using a TDBForm this value will be overridden by loadValues so it is effectively only the default for new entries.
-
bool
$store: Whether this value is persistent. Used by TDBForm to decide to save/load this value from database.
Sets the value of the field
true
setValue
(mixed $value)
-
mixed
$value: The value to set
Redefinition of:
- TFormDateTime::setValue()
- Sets the value of the field
Inherited Methods
Inherited From TFormDateTime
TFormDateTime::TFormDateTime()
TFormDateTime::getValue()
TFormDateTime::output()
TFormDateTime::setValue()
TFormDateTime::validate()
Inherited From TFormElement
TFormElement::TFormElement()
TFormElement::getValue()
TFormElement::output()
TFormElement::setParent()
TFormElement::setValue()
TFormElement::validate()