Bootstrap v5+ HTML5 Form Builder / Code Generator

If you would like a copy of this project, send an email to hockinson@gmail.com and I'll send you the PHP scripts and MySQL schema. If I was smart enough to use GITHUB I would place the project online, but I lack the time to learn how to properly use repositories. If this project offers you some ideas for creating a more comprehensive open source app for creating Bootstrap v5+ forms, that's great.

When you select one of the links in the above Schema drop-down button, a MySQL table with special column comments will be analyzed and the required PHP/HTML code generated in a few milliseconds. Including HTML form code, rough draft of PHP validation code, database connection, MySQLi INSERT statement, etc.

This project arose from a long term fascination web development, PHP, and Bootstrap. Every website that I ever worked on needed, or wanted, a Contact Us page or similar form to collect information. A very long time ago I developed a PHP script that would analyze a database teble and create PHP/HTML code required to collect, store, and email user input. More recently, it occurred to me that new INPUT types in HTML5 could be implemented in a form generator by placing specific comments the database table schema. The concept was to create a Master table schema with all sorts of INPUT types entered as a column comment. Subsequently, as new projects arise, copy the Master table schema to a new table and modify the structure and comments. And then the form generator spits out Bootstrap v5+ HTML code and PHP code in a few milliseconds.

A rough draft of the PHP code required to validate user input is automatically generated. This project is probably suitable any web developer who makes a lot of public web forms. The fact that modern browsers will display decent datepickers and time pickers without the need to add with a bunch of JavaScript and CSS is highly advantageous.

Built-in random token usage helps prevent duplicate submission, as does redirection following successful submission.

HTML5 INPUT types which can be entered as a column comment include the following:

  • color
  • date
  • datetime-local
  • email
  • file
  • month
  • number
  • password
  • range
  • search
  • tel
  • text
  • time
  • url
  • week

Alternate column comments optionally include the following:

  • checkmultiple: uses a defined SET to generate checkboxes
  • none: omit HTML INPUT's for the primary key column and certain other columns
  • radio: creates radio buttons based on the defined ENUM column
  • select: creates a SELECT box based on the defined SET or ENUM column
  • textarea: defines TEXTAREA comment boxes

Entering "required" as a comma separated comment will cause a field to be required. For example email,required without spaces.