Login Retreive lost passwordRegister
Search

Manual  /  Functions  /  Fields  /  jsDateField

(Since version FH3-v1.1)

jsDateField
jsDateField (
string $title
string $name
mixed $validator = null,
boolean $required = true,
string $mask = "d-m-y",
mixed $interval = 90,
string $extra = null,
boolean bIncludeJS = true 
)

Arguments:

Name Description
$title Title of the field
$name Name of the field
$validator This can either be the name of your own validation function or the constant name of a predefined validator function. For more information about validators see Validators.
It is also possible to use a method as a validation function. In this case you should pass an array where the first item is the object and the second item the name of the method.

(NOTE: the date is automaticly checked for a correct day-month-year combination)
$required When the field is required, the user has to select something. If the field is not required, the user can select empty values.
$mask The mask which will be used to lay out the date fields. If no mask is given, the default mask is loaded which is set in the config file with the var FH_DATEFIELD_DEFAULT_DISPLAY.

NOTE: The jsDateField will only work when d, m and y are used in the mask! If they are not all present, the field will be displayed as a normal DateField.

In the mask the following placeholders are replaced:
  • d = selectfield day

  • m = selectfield month

  • y = selectfield year

  • D = textfield day

  • M = textfield month

  • Y = textfield year



The date will be changed to the correct format when it's being saved into the database. The date will have the same format as given in the mask when it's returned to the user (in your onSaved or OnCorrect function)
$interval The interval between the current year and the years to start/stop. By default, the years are starting at 90 yeas from now. It is also possible to have years in the future. This is done like this: "90:10" (10 years in the future).
$extra This can be extra information which will be included in the fields html tag. You can add for example some CSS or javascript.
bIncludeJS Should we include javascript?
set to false on a next form on a page.

Description:

With this function you can create a date field with a jsCalendar so that the user can easily select a date.

The usage is exactly the same as a normal DateField, only this one comes with a js calendar!

Preview image

preview image

See also: DateField  |  TimeField  |  DateTextField  |  jsDateTextField

Latest change: 11 July 11 / 09:27

Comments

powered by PHP-GLOBE   © 2004 - 2024 FormHandler. All rights reserved.   -   Open source license