selectDate example

The selectDate element type gives several customization features, including defining year limits, date display formatting and date result formatting, adding/removing nullable values, and overriding default month names - take a look at these examples!

The live form - submit it!


no null values, defaults to today

default null values

...and redefined null values

...and the months are abbreviated.

Find the "data" section below to check that the returned format is different: changes to D-M-Y!

Data dump

Below are the dumps of some PHP variables - submit the form to see the changes!

Contents of the $_POST array:
$_POST = array (
)

Results of a $clonefish->getElementValues() call:
array (
  'selectdate1' => '2010-07-30',
  'selectdate2' => NULL,
  'selectdate3' => NULL,
  'selectdate4' => NULL,
  'selectdate5' => NULL,
)

There are cases when the above arrays are different. This is not a bug, but a feature: clonefish was written to help with everyday form hassles (like avoiding the missing value of an unchecked checkbox or compiling the whole date string from date selector fields).

form validation for developers!

clonefish is a proven, mature form generator class that helps PHP developers to create, validate and process secure, flexible and easy-to-maintain forms
learn more
Bookmark and Share