PHP JSON Form Builder: Generate a HTML form definition in JSON format

Recommend this page to a friend!
  Info   View files Example   Screenshots Screenshots   View files View files (5)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 394 This week: 3All time: 6,536 This week: 64Up
Version License PHP version Categories
json-form-generator 1.3MIT/X Consortium ...5HTML, PHP 5
Description Author

This class can generate a HTML form definition in JSON format.

It takes as parameter the path of a JSON file and parses it to extract the definition of the form options as well the options of all the inputs contained in the form.

The class generates HTML for the form and its inputs.

Innovation Award
PHP Programming Innovation award nominee
April 2020
Number 3
Many Web applications need to render forms to get information from their users.

This class provides an easy way to generate HTML forms from files with definitions read from a file in JSON format.

Manuel Lemos
Picture of Arash Soleimani
  Performance   Level  
Name: Arash Soleimani <contact>
Classes: 4 packages by
Country: Iran Iran
Age: ???
All time rank: 302958 in Iran Iran
Week rank: 94 Up1 in Iran Iran Up
Innovation award
Innovation award
Nominee: 2x


JSON Form Generator

LeoMoon JFG generates HTML form tags from JSON file/input. JFG supports all types and attributes of form tags.


Companies change their software every couple of years. If they have too many pages and forms, they need to redesign the whole thing again. But when you are using JSON format, you don't have to worry about redesigning everything. You just write a new JSON render engine in a new programming language or framework. Here is an example:



  $form = new Form(['file'=>'./example_form.json']);

Sample JSON file

    "name": "formName",
    "title": "Registration form",
    "description": "simple JFG example.",
    "method": "post",
    "action": "",
    "properties": {
      "firstName": {
        "type": "input",
        "title": "First name",
        "value": "test",
        "required": true,
      "lastName": {
        "type": "input",
        "title": "Last name",
        "disabled": true
      "age": {
        "type": "number",
        "title": "Age",
      "bio": {
        "type": "input",
        "title": "Bio",
      "password": {
        "type": "password",
        "title": "Password",
        "min": 3
      "language": {
        "type": "select",
        "title": "Language",
      "submit": {
        "type": "submit",
        "title": "Save Form",
  • json-form-generator-sample.jpg
  Files folder image Files  
File Role Description
Accessible without login Plain text file example.php Example Example script
Accessible without login Plain text file example_form.json Data Auxiliary data
Plain text file form.class.php Class Class source
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file Doc. Documentation

 Version Control Unique User Downloads Download Rankings  
This week:3
All time:6,536
This week:64Up
For more information send a message to info at phpclasses dot org.