'datepicker edit', 'maxlength'=>'10' ); if(!isset($this->opt['optional'])) { $attr['required'] = 'required'; $attr['class'] .= ' required'; } $this->tpl = form_makeTextField('@@NAME@@', '@@VALUE@@', '@@DISPLAY@@', '@@ID@@', '@@CLASS@@', $attr); } /** * Validate field input * * @throws Exception when empty or wrong date format */ protected function _validate() { parent::_validate(); $value = $this->getParam('value'); if (!is_null($value) && !preg_match('/^\d{2}-\d{2}-\d{4}$/', $value)) { throw new Exception(sprintf($this->getLang('e_date'),hsc($this->getParam('display')))); } } }