'String', 'attributes' => array( 'required' => 'no', 'title' => 'Title', 'description' => 'Title description', 'default' => 'Hello World', 'minlength' => 0, 'maxlength' => 200 ) ); } if (in_array('percent', $enable)) { $formDef['elements']['percent'] = array( 'type' => 'Range', 'attributes' => array( 'class' => 'form-range', 'required' => 'no', 'presets' => 'no', 'title' => 'Percent', 'description' => 'Percent description', 'default' => 20, 'min' => 0, 'max' => 100, 'step' => 5, 'values' => array( array( 'value' => '0', 'label' => '0%' ), array( 'value' => '25', 'label' => '25%' ), array( 'value' => '50', 'label' => '50%' ), array( 'value' => '75', 'label' => '75%' ), array( 'value' => '100', 'label' => '100%' ) ) ) ); } if (in_array('level', $enable)) { $formDef['elements']['level'] = array( 'type' => 'Range', 'attributes' => array( 'class' => 'form-range form-range-vertical', 'required' => 'no', 'presets' => 'no', 'title' => 'Level', 'description' => 'Level description', 'default' => 3, 'min' => 0, 'max' => 10, 'step' => 1, 'values' => array( array( 'value' => 0, 'label' => 'Lamer' ), array( 'value' => 2, 'label' => 'Novice' ), array( 'value' => 5, 'label' => 'Nerd' ), array( 'value' => 7, 'label' => 'Hacker' ), array( 'value' => 10, 'label' => 'l33t' ) ) ) ); } 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"; ?>