'String', 'attributes' => array( 'required' => 'no', 'title' => 'Title', 'description' => 'Title description', 'default' => 'Hello World', 'minlength' => 0, 'maxlength' => 200 ) ); } if (in_array('datenopresetno', $enable)) { $formDef['elements']['datenopresetno'] = array( 'type' => 'Date', 'attributes' => array( 'required' => 'no', 'presets' => 'no', 'title' => 'Datum No Presets', 'description' => 'Date description', 'default' => '2009-07-15', 'min' => '1900-01-01', 'max' => '2020-01-01', 'dateformat' => 'Y-m-d' ) ); $formDef['elements']['datenopresetnodynamic'] = array( 'type' => 'Date', 'attributes' => array( 'required' => 'no', 'presets' => 'no', 'title' => 'Datum No Presets (dynamic)', 'description' => 'Date description', 'default' => '-15 years', 'min' => '-120 years', 'max' => '-15 years', 'dateformat' => 'Y-m-d' ) ); } if (in_array('datenopresetyes', $enable)) { $formDef['elements']['datenopresetyes'] = array( 'type' => 'Date', 'attributes' => array( 'required' => 'no', 'presets' => 'yes', 'title' => 'Datum No Presets', 'description' => 'Date description', 'default' => '2013-10-04', 'min' => '1900-01-01', 'max' => '2020-01-01', 'dateformat' => 'Y-m-d' ) ); $formDef['elements']['datenopresetyesdynamic'] = array( 'type' => 'Date', 'attributes' => array( 'required' => 'no', 'presets' => 'yes', 'title' => 'Datum No Presets (dynamic)', 'description' => 'Date description', 'default' => '-10 years', 'min' => '-120 years', 'max' => '-5 years', 'dateformat' => 'Y-m-d' ) ); } if (in_array('datenative', $enable)) { $formDef['elements']['datenative'] = array( 'type' => 'Date', 'attributes' => array( 'required' => 'no', 'presets' => 'native', 'title' => 'Datum Native', 'description' => 'Date description', 'default' => '1980-07-27', 'min' => '1900-01-01', 'max' => '2020-01-01', 'dateformat' => 'Y-m-d' ) ); $formDef['elements']['datenativedynamic'] = array( 'type' => 'Date', 'attributes' => array( 'required' => 'no', 'presets' => 'native', 'title' => 'Datum Native (dynamic)', 'description' => 'Date description', 'default' => '-30 years', 'min' => '-120 years', 'max' => '-15 years', 'dateformat' => 'Y-m-d' ) ); } foreach ($formDef['elements'] as &$def) { $def['attributes']['label'] = $def['attributes']['title']; } /** @var patForms */ $form = WBClass::create('patForms', $formDef); $formStatus = 'notsubmitted'; if (!empty($_REQUEST['save'])) { $form->setSubmitted(true); if ($form->validateForm()) { $formStatus = 'valid'; } else { $formStatus = 'invalid'; } } ?>
" . print_r($form->getValues(), true) . "\n"; ?>