Select Date (month - day - year)

Create Inputs of type date for Mysql with 3 select fields

This field must be of type "date". When the date value from the database is NULL, the fields will show Month / Day / Year with value = "", if the field is required, these fields will need to be filled up.
When submitted, the 3 fields combined will generate a MySQL date value (YYYY-mm-dd) saved in a hidden input.

addField([
   'type'=>'date', //required
   'attributes'=>'required', //optional
   'startYear' => 1950, //optional
   'endYear' => 2010, //optional
   'name'=>'DOB', //optional (leave empty if you don't want to submit the value)
   'value'=>$db_items->result(0,'DOB'),  //optional (predefined value)
   'label'=>'Date of Birth', //required
   'id'=>'', //optional (name becomes the id by default)
   'style'=>'', //optional
   'class'=>'', //optional
   'blockClass'=>'', //optional (class for the container)
   'blockStyle'=>'', //optional (style for the container)
   'dataString'=>'data-test="value"', //optional (full data attribute and value)
]);

 

Quick Mode: 

addField('date:required','Date of Birth','DOB',$db_items->result(0,'DOB'));