PHP code example of pear / html_quickform2

1. Go to this page and download the library: Download pear/html_quickform2 library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pear / html_quickform2 example snippets




$form = new HTML_QuickForm2('tutorial');

// Set defaults for the form elements
$form->addDataSource(new HTML_QuickForm2_DataSource_Array([
    'name' => 'Joe User'
]));

// Add some elements to the form
$fieldset = $form->addElement('fieldset')->setLabel('QuickForm2 tutorial example');
$name = $fieldset->addElement('text', 'name', ['size' => 50, 'maxlength' => 255])
                 ->setLabel('Enter your name:');
$fieldset->addElement('submit', null, ['value' => 'Send!']);

// Define filters and validation rules
$name->addFilter('trim');
$name->addRule('