Various element examples.
Various element examplesDemonstrates the use of all element types that are fully implemented. Includes examples of element specific options.
<?php
require_once '../../HtmlForm.php';
$form->addBoolean('Boolean');
$form->addEmail('Email');
$form->addMultiple('multipleCheckbox', [
'label' => 'Multiple-checkbox',
'list' => [
'option one' => 'label one',
'option two' => 'label two',
'option three' => 'label three',
],
]);
$form->addMultiple('multipleSelect', [
'label' => 'Multiple-select',
'skin' => 'select',
'list' => [
'option one' => 'label one',
'option two' => 'label two',
'option three' => 'label three',
],
]);
$form->addNumber('Number', [
'min' => 0,
'max' => 10,
'step' => 2,
]);
$form->addPassword('Password');
$form->addRange('Range', [
'min' => 0,
'max' => 10,
]);
$form->addSingle('singleRadio', [
'label' => 'Single-radio',
'list' => [
'option one' => 'label one',
'option two' => 'label two',
'option three' => 'label three',
],
]);
$form->addSingle('SingleSelect', [
'label' => 'Single-select',
'skin' => 'select',
'list' => [
'option one' => 'label one',
'option two' => 'label two',
'option three' => 'label three',
],
]);
$form->addTel('Tel');
$form->addText('Text');
$form->addTextarea('Textarea');
$form->addUrl('URL');
$fieldset = $form->addFieldset('Fieldset');
$fieldset->addText('Text2');
$form->addCreditcard('creditcard');
$form->addHtml('Custom <b>HTML</b> element');
$form->process();
if ($form->validate()) {
echo('<a href="">back</a>');
echo('<pre>');
var_dump($form->getValues());
echo('</pre>');
$form->clearSession();
} else {
?>
<!DOCTYPE html>
<head>
<link rel="stylesheet" type="text/css" href="../../lib/css/depage-forms.css">
</head>
<body>
<?php echo($form); ?>
</body>
<?php
}