[TYPO3-dev] BE Module: How to add a datepicker to an input

Stephen Bungert stephenbungert at yahoo.de
Fri Nov 18 14:47:06 CET 2011


I just tried calling the TCE form function using some dummy data and it 
worked, it even created datepicking fields.

Here is my test function:



 protected function test() {
  #$PA['fieldChangeFunc'] = ''; // Onnchange function, if required
  $PA['itemFormElName'] = 'test3';
  $PA['itemFormElValue'] = 'test3value'; // Value the form element should 
have

  // Text field config
  $PA['fieldConf']['config'] = array(
   'type' => 'input',
   'size' => '30',
   'eval' => 'required,trim'
  );

  // Datetime
  // Works but there is no JS to make the calendar function, need to maybe 
add JS as Francois suggested:
  #$pageRenderer->addJsFile($this->backPath . 
'../t3lib/js/extjs/tceforms.js');
  #$pageRenderer->addJsFile($this->backPath . 
'../t3lib/js/extjs/ux/Ext.ux.DateTimePicker.js');

  #$PA['fieldConf']['config'] = array(
  # 'type'     => 'input',
  # 'size'     => '8',
  # 'max'      => '20',
  # 'eval'     => 'datetime',
  # 'default'  => '0',
  # 'checkbox' => '0',
  # 'default' => mktime(date("H"),date("i"),0,date("m"),date("d"),date("Y"))
  #);
  $row = array(
   'uid' => '1'
  );

  $t3libTCEformsObj = t3lib_div::makeInstance('t3lib_TCEforms');
  return $t3libTCEformsObj->getSingleField_typeInput('dummytable', 
'testtest', $row, &$PA);
 } 




More information about the TYPO3-dev mailing list