PHP Form Builder - Bootstrap Form Generator - 20+ jQuery plugins

# Thank you for purchasing
PHP Form Builder
PHP Form Generator Class - Save tons of programming hours

Open the Quick Start Guide
to register your copy & get started

#### For any question or request

- Take a look at the Help Center
- Contact me through PHP Form Builder's comments on Codecanyon
- E-mail me at https://www.miglisoft.com/#contact
- Chat on www.phpformbuilder.pro

If you feel lost or have any trouble, please contact me

- I can build you a form for free, or for a small fee if your form is a complex one
- I can propose a refund if PHP Form Builder doesn't match what you intended

#### Please if you like Php Form Builder

Don't forget to rate it at https://codecanyon.net/downloads (login to your account and go to download page) And/Or drop a review at https://goo.gl/teKs6x

## Where to start?

Depending on your preferences:

### Quick and easy form building

Drag & Drop
Form Generator
  You'll just have to drag and drop the form elements, choose your settings then paste the generated code.

### PHP Beginners

Beginners Guide
  Tutorial for PHP beginners including full detailed explanations

### PHP Programmers

Quickstart Guide
  Quick and easy start with minimum required.

### About functions and how to

Class documentation
  Full class documentation.
Code Samples
  FAQ with code examples to help with layout, icons, plugins, dependent fields, etc.
Functions reference
  All functions & arguments.

## Package Structure

PHP Form Builder's package includes the Form Builder itself, the drag and drop form builder, the documentation, and hundreds of templates.

You don't have to upload all the files and folders on your production server.

The documentation, the Drag & Drop Form Builder and the Templates are available online, there's no need to upload them on your production server.

Follow our Quick Start Guide to get started, install and begin using PHP Form Builder.

## Features

- Form generation with complex layout capabilities (horizontal, vertical, inline)
  PHP Form Builder generates clean HTML5 markup, with separates functions to render form, generate CSS and JS code, so you can render them separately (generally in <head> or just before </body>).

- Creates Bootstrap 4 Forms, Bootstrap 5 Forms, Bulma Forms, Foundation Forms, Material Design Forms, Tailwind Forms, uiKit Forms.

- Compatible with any framework or can be used standalone.

- Accepts any HTML5 form elements, including fieldsets, multiple selects, optgroups, button groups, ...

- Allows customizing HTML with wrappers, IDs, classes and attributes, JavaScript events, custom code anywhere.

- Server-side validation can be done on any destination page; errors are stored in the PHP session.

- Sends your emails with a simple or advanced function.

- Detects and replaces posted values in default or custom HTML/CSS template. Uses PHPMailer and Emogrifier to inline CSS.

- Uses PHPMailer with or without SMTP and Emogrifier to inline CSS.

- XSS / CSRF Protection

- PDO Database library included to prefill fields with values from your database easily, Create/Read/Update/Delete elements using the posted values (CRUD operations).

- ### High-quality JavaScript plugins, including:

  Checkboxes, Radio buttons & Selects

  - Pretty Checkbox
  - Select2
  - Slimselect
  - Bootstrap Select
  - iCheck
  - Nice Check
  - LC-Switch

  Pickers

  - Colorpicker
  - Litepicker (Date / Date range picker)
  - Image picker
  - Material Design Datepicker
  - Material Design Timepicker
  - Pickadate Datepicker
  - Pickadate Timepicker

  Validation, Captcha & Anti-SPAM

  - Formvalidation
  - Altcha / Anti-SPAM
  - JS-Captcha
  - HCaptcha
  - Google Recaptcha

  Modal & Popover

  - Modal
  - Popover

  Uploaders

  - File Uploader

  Text Editors

  - Tinymce

  Others

  - Accordion
  - Autocomplete
  - Bootstrap Input Spinner
  - Dependent Fields
  - Intl Tel Input (International Phone Numbers)
  - Ladda (Buttons spinners)
  - Material Design
  - Passfield
  - Tooltip
  - Signature pad
  - Wordcharactercount

- Memorization/recall of any custom configuration for each plugin

- You can easily add any other external plugin (see plugins section).
  PHP Form Builder automatically adds the needed CSS and JS files to your page when you activate a plugin.

- Free Visual Studio Code extension available on Visual Studio Marketplace

- Free Sublime-text 3 plugin available on Github

- Free Bracket plugin available on Github

## Themes (Frameworks)

All options are ready to use and will generate HTML markup according to the chosen framework.

The default framework is Bootstrap 5.

If none of the available frameworks powers your website,
PHP Form Builder provides a minimal version of Bootstrap 5 CSS to design your forms.

### Bootstrap 4

    $form = new Form('my-form', 'horizontal', 'novalidate', 'bs4');

### Bootstrap 5 Default

    $form = new Form('my-form', 'horizontal', 'novalidate');

### Bulma

    $form = new Form('my-form', 'horizontal', 'novalidate', 'bulma');

### Foundation - v6.4 or higher, with XY grid

    $form = new Form('my-form', 'horizontal', 'novalidate', 'foundation');

### Material Design

Material Design forms are built with Materialize framework.

You can design your forms with the Material framework both on pages built with Materialize and with Bootstrap 4.

- If your website uses the Materialize framework:

      $form = new Form('my-form', 'horizontal', 'novalidate', 'material');

- If your website uses the Bootstrap 4 framework:

      $form = new Form('my-form', 'horizontal', 'novalidate', 'material');

              // materialize plugin
              $form->addPlugin('materialize', '#my-form');

### Tailwind

    $form = new Form('my-form', 'horizontal', 'novalidate', 'tailwind');

### UIKit

    $form = new Form('my-form', 'horizontal', 'novalidate', 'uikit');

### No framework

Add the minimal Bootstrap 5 CSS to your page head, then you can build your forms with Bootstrap 5.

This style sheet only includes what is necessary to layout your responsive forms and will not break anything in the other parts of your pages.

    <head>
                // link to the minimal Bootstrap 5 CSS
                <link rel="stylesheet" href="/phpformbuilder/templates/assets/bootstrap5-phpfb/css/bootstrap5-phpfb.min.css">
            </head>
            <?php
            // Then you can build your form
            $form = new Form('my-form', 'horizontal', 'novalidate');

More details about `__construct()` here: Main functions > General > Construct

## License and Registration

### License

1 License = 1 project

If you want to use PHP Form Builder on several websites, you've got to buy a new license for each one.

Standard license vs. extended license

- The Standard license allows two installations to run simultaneously: one for your local development and one for your production server.
- We offer special prices for agencies and professional developers (up to 50%) with the Extended license. Please contact us for more information.

### Registration

Before using PHP Form Builder, you must register your copy.

Registration is for a lifetime & just has to be done once for each installation (localhost/production server).

To unregister/register again with another hostname/URL:

1. Open `phpformbuilder/register.php` to unregister your copy
2. Move your folders where you want to
3. Open `phpformbuilder/register.php` to record your new path

## Upgrade PHP Form Builder

1. Backup your `phpformbuilder` folder
2. Replace your old `phpformbuilder` folder with the new one
3. Copy your `[your-domain]/license.php` from your old installation to the new one
4. Copy your database connection file from `phpformbuilder/vendor/migliori/power-lite-pdo/src/connection.php` to its new location
5. If you customized the following files/folders, copy them from your old installation to the new one:
   - `phpformbuilder/mailer/email-templates-custom`
   - `phpformbuilder/plugins-config-custom`
   - `phpformbuilder/class/phpformbuilder/FormExtended.php`

## Visual Studio Code extension

PHP Form Builder Visual Studio Code extension is available on Visual Studio Code Marketplace

The extension adds auto-completion for all Form Builder functions.

## Sublime Text plugin

PHP Form Builder Sublime Text plugin is available on Package Control

The plugin adds auto-completion for all Form Builder functions.

### Changelog

This changelog is for the current Major versions 5 & 6 only.

The previous versions' changelog is available here in the help center.

To migrate from version 5 to version 6 please follow this guide: https://www.phpformbuilder.pro/documentation/help-center.php#migration

version 6.2 (08/2025)

            Improvements:
                - remove the "required" attribute from the radio & checkboxes labels
                - rewrite the cURL test script for better clarity and readability
            Bug Fix:
                - fix fileuploader removing the extension from the filename if the filename itself contains the extension string
                - move $_SESSION[token] to $_SESSION[form][token] in the templates with dynamic fields
                - fix Validator::validate() method error with arrays and recursive validation

version 6.1 (01/2025)

            Improvements:
                - upgrade PowerLite PDO to the latest version
            Bug Fix:
                - fix the PHP validator's 'required' validation with "0" string values

version 6.0.5 (12/2024)

            Bug Fix:
                - fix the PHP validator's 'required' validation when the fields are not posted
                - fix the file uploader code generated by the drag & drop form builder
                - fix the image uploader's editor to save files & thumbnails after editing
                - fix the checkbox columns width in the drag & drop form builder
                - fix php typings in the drag & drop form builder for php 7.4

version 6.0.4 (07/2024)

            Improvements:
                - disable the floating labels in the date input fields
            Bug Fix:
                - fix email sending with BCC
                - fix a cross-browser bug with the floating-labels plugin
                - fix the plugins URL detection with symlinks
                - fix php 'required' validation on empty strings
                - fix a type error in validator::hasPattern()

version 6.0.3 (06/2024)

            Bug Fix:
                - fix missing input placeholders in the drag & drop form builder

version 6.0.2 (05/2024)

            Bug Fix:
                - fix PHP composer error with PHP < 8.2
                - fix types error with php < 8.0
                - fix floating labels position in Modal forms
                - disable the floating labels in tinymce textareas

version 6.0.1 (05/2024)

            Bug Fix:
                - fix the plugins path & URL when the form builder is in a subfolder
                - fix the addCountry method when there's multiple country fields on the same page.

version 6.0 (05/2024)

            Breaking changes:
                - PHP Form Builder now uses a global autoloader for the Form Builder's classes, the mailer, the database and pagination classes
            New Features:
                - add the Altcha plugin with Anti-SPAM features - https://www.phpformbuilder.pro/documentation/javascript-plugins.php#recaptchav3-example
                - add the Floating Labels plugin - https://www.phpformbuilder.pro/documentation/javascript-plugins.php#floating-labels
                - add the "addError($field, $message)" function to the Validator
            Improvements:
                - redesign the drag & drop form builder with code refactoring and performance improvements
                - add a global autoloader for the Form Builder's classes, the mailer, the database and pagination classes
                - improve robustness, code quality and reliability with PHPSTAN's highest standards (level 8)
                - move the Database & pagination classes to the "vendor" folder and use the Github public package (https://github.com/migliori/power-lite-pdo)
                - add the "getIncludes($debug = false)" function to get the list of all the plugins dependencies (JS & CSS)
                - add the "getJsCode($debug = false)" function to get the Javascript code of the activated plugins
                - change the naming convention of the php variables from snake_case to smallCamelCase
                - move the bottom margins in Bootstrap forms from rows to columns
            Bug Fix:
                - fix a bug with the file uploader with multiple instances and required files
                - fix a type error in the file uploader with php 8.3+
                - fix Tinymce's filemanager bug with PHP ^8.0
                - fix drag & drop form builder's input patterns for Chrome - https://github.com/GoogleChrome/chromium-dashboard/issues/3106

version 5.3 (01/2024)

            New Features:
                - add the code for Recaptcha to be properly loaded in Ajax forms
            Improvements:
                - add php type hinting and enable PHP strict_types
                - fix PHP 8.3 deprecation warnings
                - review PHP Standard compliance with PHPCS and PHPCBS - Standard:PHPCompatibility 7.4-8.3
                - add SQL group_by clause in DB->select() '$extras' argument
                - update the Signature Pad plugin to the latest version (v4.1.6)
                - add the 'data-height' attribute to the Signature Pad input
            Bug Fix:
                - repair the database getLastInsertId() function
                - fix "update" queries using the same fieldname in both values and where clause
                - fix Deprecated error in class.fileuploader.php

version 5.2.1 (01/2023)

            New Features:
                - Support of different RDBMS with PDO drivers (MySQL/MariaDB, Oracle, PostgreSQL, Firebird)
                - add new functions to the database PDO wrapper: https://www.phpformbuilder.pro/documentation/php-pdo-database-class.php
            Improvements:
                - Improve Dependent fields events management & performance
                - handle required fields validation inside nested dependent fields
            Bug Fix:
                - The events on inputs with the Pretty checkbox plugin enabled will now work as expected
                - update the Passfield plugin to solve a Popover bug with the latest Bootstrap
                - memorization of the 'inline' checkbox/radio value in the drag & drop form builder

version 5.2 (10/2022)

            New Features:
                - add new functions to the database PDO wrapper: https://www.phpformbuilder.pro/documentation/php-pdo-database-class.php
                - add the "limit" argument to the "select" function of the database PDO wrapper
                - add the getOptions() function to show the list of the current options (or single/multiple options values)
            Improvements:
                - add the "utf-8" charset in the DB connection settings
                - upgrade the Slimselect plugin to the latest version v1.27.1
            Bug Fix:
                - Dependent fields will not be posted anymore when they're hidden
                - fix the broken links in the index.html if the Codecanyon package

version 5.1 (07/2022)

            New Features:
                - add ability to copy (duplicate) fields in the Drag and Drop form builder
            Improvements:
                - add max-height + vertical scrollbars to the Drag and Drop form builder
                - disable the hcaptcha's recaptcha compat option
                - update the template's ajax-loaded-multiple-forms
                - update the Select2 plugin to its latest version 4.1.0-rc.0
            Bug Fix:
                - edit the intltelinput Javascript to set the full phone value in real time (was buggy since the last plugin upgrade)
                - fix formValidation plugin not revalidating after removing file with fileuploader when upload limit is set to 1

version 5.0.6 (03/2022)

            New Features:
                - ability to center the HCaptchas with the Drag & Drop
            Improvements:
                - add a "no action" option in the drag & drop for the form action after validation
                - add a regexp and helper text to validate the components names entered by the user in the Drag & Drop
            Bug Fix:
                - fix use of array_key_last with php < 7.3
                - fix formvalidation code for Tinymce required fields
                - remove Tinymce from the compiled Javascript to avoid 404 errors on Tinymce dependencies

version 5.0.5 (03/2022)

            Improvements:
                - show the warning message on file uploader failure
                - add a warning message in the drag & drop on database update if no field has been specified in the WHERE clause
                - show the HTML code in the drag & drop HTML components
                - add "copy" buttons to all the code blocks in drag & drop and documentation
            Bug Fix:
                - fix paths of the file uploader email attachments generated by the drag & drop form builder
                - fix and improve the plugins loading system after POST with Ajax
                - fix the database insert code generated by the drag & drop
                - fix the database update code generated by the drag & drop
                - fix script loading & triggering issues with Ajax

version 5.0.4 (03/2022)

            Improvements:
                - Improve the drag & drop layout
            Bug Fix:
                - fix the File uploader code with drag & drop and Ajax

version 5.0.3 (03/2022)

            Improvements:
                - add instructions for CMS users in the Quickstart Guide
                - remove Typography CSS from the custom minimal Bootstrap 5 CSS version (templates/assets/bootstrap5-phpfb)
                - replace the jQuery code generated by the Drag & drop form builder with a clean Vanilla JavaScript code
            Bug Fix:
                - replace a stupid white text on white background in the drag & drop form code modal
                - edit the LCSwitch plugin to make it work with inputs inside labels
                - add the Materialize base JavaScript, which was missing when loading forms with Ajax

version 5.0.2 (03/2022)

            Bug Fix:
                - solve a bug with the file uploader & images

version 5.0.1 (03/2022)

            New Features:
            Improvements:
                - add instructions for CMS users in the Quickstart Guide
            Bug Fix:
                - replace a stupid white text on white background in the drag & drop form code modal
                - edit the LCSwitch plugin to make it work with inputs inside labels

version 5.0 - Major update (03/2022)

            - upgrade to Bootstrap 5
            - remove jQuery except for the plugins that require it
            - add Bulma configuration & templates
            - add Tailwind configuration & templates
            Plugins:
                - update all the plugins to their latest version
                - rewrite all the jQuery instantiation codes in Vanilla JS for all non-jQuery plugins (in plugins-config/*.xml files)
                - add a new Accordion plugin for accordion step forms
                - replace jQuery autocomplete by autoComplete.js (vanilla js)
                - replace jQuery captcha (realPerson) by js-captcha (vanilla js)
                - add jsCaptcha server-side validation
                - add hCaptcha plugin
                - remove the old recaptcha v2 plugin
                - replace the jQuery-Color-Picker by a new colorpicker plugin (vanilla js)
                - rewrite the Dependent Fields jQuery plugin in vanilla js
                - replace the modal plugin by a new lightweight accessible vanilla js modal plugin
                - rewrite the Nice Check jQuery plugin in vanilla js
                - replace the Popover and jQuery Tooltip plugin with the amazing vanilla js TippyJs
                - activate plugins with data-attributes instead of classnames to avoid conflicts. ie: 'data-input-spinner=true' instead of 'class=input-spinner'
                - update & rewrite the lcSwitch JavaScript & replace themes by data-attributes (data-oncolor and data-oncss)
                - improve the website accessibility with the new excellent Chrome CSS Overview tool
                - remove the "dist" folders in the plugins folders and move the files directly in thir parent folder
                - update Bootswatch themes and add them to the Bootstrap 4 + Bootstrap 5 templates
            Functions & code:
                - replace the MySQL class with the PDO version (https://www.phpclasses.org/package/10844-PHP-Access-MySQL-databases-using-the-PDO-extension.html)
                - add a new addheading() method
                - add a new buildAlert() static method
                - add a new addTimeSelect() method
                - remove the unused 'type' argument in addFileUpload() function
                - improve the 'sent_message' option behaviour in the sendMail() method
                - replace the centerButtons() function with the new centerContent() function
                - rename the groupInputs() function by groupElements() for a better consistency
                - remove the form inline layout - use horizontzal with grouped fields instead
                - split the Form class into PHP Traits to improve the readability of the code and to group the functions in a logical way
                - lint code with PHPCS & Sonarlint
            Templates:
                - add new templates for each framework
                - replace All the jQuery code with Vanilla JS code
                - replace the complex "email-styles" form with a basic "email-templates" form - easier to understand
            Drag & drop:
                - Complete update with integration of new frameworks, plugins and features

## Sources & Credits

Thanks so much to:

- https://github.com/stuartjnelson/badger-accordion
- https://github.com/TarekRaafat/autoComplete.js
- https://github.com/shaack/bootstrap-input-spinner
- https://silviomoreto.github.io/bootstrap-select/
- https://github.com/Simonwep/pickr
- https://innostudio.de/fileuploader/
- https://formvalidation.io/
- https://hcaptcha.com
- https://github.com/fronteed/icheck
- https://rvera.github.io/image-picker/
- https://github.com/jackocnr/intl-tel-input
- https://github.com/robiveli/js-captcha
- https://github.com/hakimel/Ladda
- https://lcweb.it/lc-switch-javascript-plugin
- https://wakirin.github.io/Litepicker/
- https://materializecss.com/
- https://github.com/Ghosh/micromodal
- https://antelle.net/passfield/
- https://amsul.ca/pickadate.js/
- https://atomiks.github.io/tippyjs/
- https://github.com/lokesh-coder/pretty-checkbox
- https://www.google.com/recaptcha/
- https://select2.org/
- https://github.com/szimek/signature_pad
- https://slimselectjs.com
- https://www.tiny.cloud/tinymce/
- blackbelt's php-validation class
- https://github.com/migliori/power-lite-pdo
- https://www.responsivefilemanager.com/*
- https://github.com/PHPMailer/PHPMailer
- https://github.com/jjriv/emogrifier
- https://github.com/muicss/loadjs

### About Responsive File Manager

Responsive File Manager is under Creative Commons Attribution-NonCommercial 3.0 Unported License.
The author kindly allowed me to include it with PHP Form Builder.
PHP Form Builder users can use it without limitation for non-commercial projects.

If you want to use Responsive File Manager in commercial projects, don't hesitate to contact the author and ask him for his agreement. A small donation is welcome.

## About

I'm a french web developer; I work on many enthusiastic projects for clients as a freelancer, mainly handmade websites or web applications.

I spend time every day helping people using PHP Form Builder worldwide.

Feel free to contact me about any project/request

Others works

### PHP CRUD Generator

PHP CRUD Generator
Simple application to build Bootstrap backoffice for your website

### Slider Maker

How to build jQuery slideshows & galleries without coding
Login to the admin panel and create high-quality, responsive slideshows in a visual way

### TinyMce Bootstrap plugin

TinyMce plugin to insert Bootstrap elements into your page

### DMCA Sender - Anti-Piracy solution

DMCA Sender - Online SaaS application to find illegal download links to your softwares & applications.
Auto-send your DMCA Takedown Notice