PHP Classes

Form Builder: Generate HTML and Javascript for displaying forms

Recommend this page to a friend!
  Info   Example   Screenshots   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 53%Total: 3,328 All time: 1,037 This week: 38Up
Version License PHP version Categories
formbuilder 0.9.3GNU General Publi...5.0HTML, PHP 5, Time and Date, Validation, A...
Description 

Author

This class can be used to generate HTML and Javascript for displaying forms.

This project promotes rapid development of forms through an object-oriented PHP structure, eliminates the grunt/repetitive work of writing the html and javascript validation when building forms, reduces human error by using a consistent/tested utility, and incorporate complex elements such as ajax, jquery, google maps, tooltips, captcha, and html web editors quickly and with little effort.

There are 15 example files that provide multiple implementations of the class and will give you a head start in your development. Also, there are currently 3 YouTube videos that provide a more in-depth look various pieces of the project.

Picture of Andrew P.
Name: Andrew P. <contact>
Classes: 2 packages by
Country: United States United States
Age: 40
All time rank: 74699 in United States United States
Week rank: 192 Up22 in United States United States Up

Example

<?
include("../class.form.php");

if(!isset(
$cmd))
   
$cmd = "";

if(
$cmd == "submit")
{
    echo(
"<pre>");
   
print_r($_POST);
    echo(
"</pre>");
    exit();
}

if(
$cmd == "")
{
   
?>
<html>
        <head></head>
        <body>
            <h2 style="text-align: center; margin: 0; padding: 0;">Form Builder Class - Examples</h2>
            <h5 style="text-align: center; margin: 0; padding: 0;"><span style="padding-right: 10px;">Author: Andrew Porterfield</span><span style="padding-right: 10px;">Released: <?=file_get_contents('../release')?></span><span>Version: <?=file_get_contents('../version')?><span></h5>
            <div style="text-align: center; padding-bottom: 10px;"><a href="http://code.google.com/p/php-form-builder-class/" target="_blank">View in Google Code Project Hosting</a> | <a href="http://www.phpclasses.org/browse/package/5350.html" target="_blank">View in the PHP Classes Repository</a><br><a href="http://php-form-builder-class.googlecode.com/files/formbuilder.zip" target="_blank">Download Source from Google rode Project Hosting</a></div>
            <a href="../index.php">Back to Project Home Page</a>
            <p><b>Buttons</b> - This example demonstrates how buttons are handled within the class.
            <?
            $form
= new form();
           
$form->setAttributes(array(
               
"tableAttributes" => array("width" => "400"),
            ));
           
$form->addHidden("cmd", "submit");
           
$form->addTextbox("Textbox:", "field0");
           
$form->addSelectbox("Selectbox:", "field1", "", array("" => "--Select an Option--", "option1" => "Option 1", "option2" => "Option 2"));
           
$form->addCheckbox("Checkbox:", "field2", "", array("option1" => "Option 1"));

           
//Add Standard Submit Button
           
$form->addButton();

           
//Add Non-Submit Button W/OnClick Event
           
$form->addButton("php.net", "button", array("onclick" => "window.location = \"http://www.php.net\";"));

           
/*
            If your system has a utility in place for dynamically generating button images, you will want to utilize the phpFunction, phpParams, wrapLink, and hrefAttributes parameters. A sample is provided below of what this call might look like. View the source of class.form.php to learn more about these parameters.
            $form->addButton("", "", array("phpFunction" => "RenderDynamicButton", "phpParams" => array("param1","param2"), "wrapLink" => 1, "linkAttributes" => array("href" => "http://www.php.net/")));
            */

           
$form->render();
           
?>
<a href="../index.php">Back to Project Home Page</a>
        </body>
    </html>
    <?
}
?>



  Files folder image Files (156)  
File Role Description
Files folder imageanimatedcaptcha (2 files, 1 directory)
Files folder imageexamples (16 files)
Files folder imagejquery (5 files, 2 directories)
Files folder imagetiny_mce (4 files, 4 directories)
Plain text file class.form.php Class Form Builder Class Files
HTML file index.php Doc. Introduction, Instructions, and Examples
Plain text file license Lic. License Information
Plain text file release Data Current Version's Release Date
Plain text file version Data Current Version Number
Image file youtube.png Icon youtube logo

  Files folder image Files (156)  /  animatedcaptcha  
File Role Description
Files folder imageframes (15 files)
  Plain text file captcha.php Aux. captcha script
  Plain text file GIFEncoder.class.php Aux. captcha script

  Files folder image Files (156)  /  animatedcaptcha  /  frames  
File Role Description
  Image file 0.gif Icon captcha script
  Image file 1.gif Icon captcha script
  Image file 2.gif Icon captcha script
  Image file 3.gif Icon captcha script
  Image file 4.gif Icon captcha script
  Image file 5.gif Icon captcha script
  Image file 6.gif Icon captcha script
  Image file 7.gif Icon captcha script
  Image file 8.gif Icon captcha script
  Image file 9.gif Icon captcha script
  Image file equals.gif Icon captcha script
  Image file minus.gif Icon captcha script
  Image file plus.gif Icon captcha script
  Image file solve.gif Icon captcha script
  Image file times.gif Icon captcha script

  Files folder image Files (156)  /  examples  
File Role Description
  Plain text file ajax.php Example Ajax Form Submission
  Plain text file ajaxSubmission.php Example Ajax Form Submission Handler
  Plain text file buttons.php Example Buttons
  Plain text file captcha.php Example Captcha
  Plain text file custom.php Example Custom Implementation
  Plain text file elements.php Example All Supported Form Elements
  Plain text file googlemaps.php Example Google Maps
  Plain text file jquery.php Example jQuery UI
  Plain text file js_validation.php Example Javascript Validation
  Plain text file parameters.php Example Miscellaneous Parameters
  Plain text file php_validation.php Example PHP Validation
  Plain text file prefilling.php Example Pre-Filling Form Elements
  Plain text file structure.php Example Table Structure Flexibility
  Plain text file styling.php Example CSS Styling
  Plain text file tooltip.php Example Tooltips
  Plain text file webeditor.php Example Web Editor

  Files folder image Files (156)  /  jquery  
File Role Description
Files folder imageimages (28 files)
Files folder imageqtip (3 files)
  Plain text file daterangepicker.jquery.js Aux. jQuery Date Picker Javascript
  Plain text file jquery-1.3.2.min.js Data jQuery Javascript File
  Plain text file jquery-ui-1.7.2.custom.css Aux. jquery css file
  Plain text file jquery-ui-1.7.2.custom.min.js Aux. jquery javascript file
  Plain text file ui.daterangepicker.css Aux. jQuery Date Picker CSS

  Files folder image Files (156)  /  jquery  /  images  
File Role Description
  Image file 217bc0_256x240_icons_icons.png Data jQuery Image
  Image file 2e83ff_256x240_icons_icons.png Data jQuery Image
  Image file 469bdd_256x240_icons_icons.png Data jQuery Image
  Image file 5c9ccc_500x100_tex...2_gloss_wave_55.png Data jQuery Image
  Image file 6da8d5_256x240_icons_icons.png Data jQuery Image
  Image file aaaaaa_40x100_textures_01_flat_0.png Data jQuery Image
  Image file cd0a0a_256x240_icons_icons.png Data jQuery Image
  Image file d0e5f5_40x100_textures_02_glass_75.png Data jQuery Image
  Image file d8e7f3_256x240_icons_icons.png Data jQuery Image
  Image file dfeffc_40x100_textures_02_glass_85.png Data jQuery Image
  Image file f5f8f9_40x100_text..._inset_hard_100.png Data jQuery Image
  Image file f9bd01_256x240_icons_icons.png Data jQuery Image
  Image file fbec88_40x100_textures_01_flat_55.png Data jQuery Image
  Image file fcfdfd_40x100_text..._inset_hard_100.png Data jQuery Image
  Image file fef1ec_40x100_textures_02_glass_95.png Data jQuery Image
  Image file ui-bg_flat_0_aaaaaa_40x100.png Data jQuery Image
  Image file ui-bg_flat_75_ffffff_40x100.png Data jQuery Image
  Image file ui-bg_glass_55_fbf9ee_1x400.png Data jQuery Image
  Image file ui-bg_glass_65_ffffff_1x400.png Data jQuery Image
  Image file ui-bg_glass_75_dadada_1x400.png Data jQuery Image
  Image file ui-bg_glass_75_e6e6e6_1x400.png Data jQuery Image
  Image file ui-bg_glass_95_fef1ec_1x400.png Data jquery Image
  Image file ui-bg_highlight-soft_75_cccccc_1x100.png Data jquery Image
  Image file ui-icons_222222_256x240.png Data jquery Image
  Image file ui-icons_2e83ff_256x240.png Data jquery Image
  Image file ui-icons_454545_256x240.png Data jquery Image
  Image file ui-icons_888888_256x240.png Data jquery Image
  Image file ui-icons_cd0a0a_256x240.png Data jquery Image

  Files folder image Files (156)  /  jquery  /  qtip  
File Role Description
  Plain text file jquery.qtip-1.0.0-rc3.min.js Aux. qTip Javascript File
  Plain text file LICENSE Lic. qTip License
  Image file tooltip_icon.png Icon Default Tooltip Icon

  Files folder image Files (156)  /  tiny_mce  
File Role Description
Files folder imagelangs (1 file)
Files folder imageplugins (3 directories)
Files folder imagethemes (2 directories)
Files folder imageutils (4 files)
  Plain text file license.txt Lic. tinymce license
  Plain text file tiny_mce.js Aux. tinymce js file
  Plain text file tiny_mce_popup.js Aux. tinymce js file
  Plain text file tiny_mce_src.js Aux. tinymce js file

  Files folder image Files (156)  /  tiny_mce  /  langs  
File Role Description
  Plain text file en.js Aux. tinymce js file

  Files folder image Files (156)  /  tiny_mce  /  plugins  
File Role Description
Files folder imagepaste (4 files, 2 directories)
Files folder imagesafari (3 files)
Files folder imagetable (6 files, 3 directories)

  Files folder image Files (156)  /  tiny_mce  /  plugins  /  paste  
File Role Description
Files folder imagejs (2 files)
Files folder imagelangs (1 file)
  Plain text file editor_plugin.js Aux. tinymce js file
  Plain text file editor_plugin_src.js Aux. tinymce js file
  HTML file pastetext.htm Aux. tinymce html file
  HTML file pasteword.htm Aux. tinymce html file

  Files folder image Files (156)  /  tiny_mce  /  plugins  /  paste  /  js  
File Role Description
  Plain text file pastetext.js Aux. tinymce js file
  Plain text file pasteword.js Aux. tinymce js file

  Files folder image Files (156)  /  tiny_mce  /  plugins  /  paste  /  langs  
File Role Description
  Plain text file en_dlg.js Aux. tinymce js file

  Files folder image Files (156)  /  tiny_mce  /  plugins  /  safari  
File Role Description
  HTML file blank.htm Aux. tinymce html file
  Plain text file editor_plugin.js Aux. tinymce js file
  Plain text file editor_plugin_src.js Aux. tinymce js file

  Files folder image Files (156)  /  tiny_mce  /  plugins  /  table  
File Role Description
Files folder imagecss (3 files)
Files folder imagejs (4 files)
Files folder imagelangs (1 file)
  HTML file cell.htm Aux. tinymce html file
  Plain text file editor_plugin.js Aux. tinymce js file
  Plain text file editor_plugin_src.js Aux. tinymce js file
  HTML file merge_cells.htm Aux. tinymce html file
  HTML file row.htm Aux. tinymce html file
  HTML file table.htm Aux. tinymce html file

  Files folder image Files (156)  /  tiny_mce  /  plugins  /  table  /  css  
File Role Description
  Plain text file cell.css Aux. tinymce css file
  Plain text file row.css Aux. tinymce css file
  Plain text file table.css Aux. tinymce css file

  Files folder image Files (156)  /  tiny_mce  /  plugins  /  table  /  js  
File Role Description
  Plain text file cell.js Aux. tinymce js file
  Plain text file merge_cells.js Aux. tinymce js file
  Plain text file row.js Aux. tinymce js file
  Plain text file table.js Aux. tinymce js file

  Files folder image Files (156)  /  tiny_mce  /  plugins  /  table  /  langs  
File Role Description
  Plain text file en_dlg.js Aux. tinymce js file

  Files folder image Files (156)  /  tiny_mce  /  themes  
File Role Description
Files folder imageadvanced (9 files, 4 directories)
Files folder imagesimple (2 files, 3 directories)

  Files folder image Files (156)  /  tiny_mce  /  themes  /  advanced  
File Role Description
Files folder imageimg (2 files)
Files folder imagejs (7 files)
Files folder imagelangs (2 files)
Files folder imageskins (2 directories)
  HTML file about.htm Aux. tinymce html file
  HTML file anchor.htm Aux. tinymce html file
  HTML file charmap.htm Aux. tinymce html file
  HTML file color_picker.htm Aux. tinymce html file
  Plain text file editor_template.js Aux. tinymce js file
  Plain text file editor_template_src.js Aux. tinymce js file
  HTML file image.htm Aux. tinymce html file
  HTML file link.htm Aux. tinymce html file
  HTML file source_editor.htm Aux. tinymce html file

  Files folder image Files (156)  /  tiny_mce  /  themes  /  advanced  /  img  
File Role Description
  Image file colorpicker.jpg Icon tinymce image
  Image file icons.gif Icon tinymce image

  Files folder image Files (156)  /  tiny_mce  /  themes  /  advanced  /  js  
File Role Description
  Plain text file about.js Aux. tinymce js file
  Plain text file anchor.js Aux. tinymce js file
  Plain text file charmap.js Aux. tinymce js file
  Plain text file color_picker.js Aux. tinymce js file
  Plain text file image.js Aux. tinymce js file
  Plain text file link.js Aux. tinymce js file
  Plain text file source_editor.js Aux. tinymce js file

  Files folder image Files (156)  /  tiny_mce  /  themes  /  advanced  /  langs  
File Role Description
  Plain text file en.js Aux. tinymce js file
  Plain text file en_dlg.js Aux. tinymce js file

  Files folder image Files (156)  /  tiny_mce  /  themes  /  advanced  /  skins  
File Role Description
Files folder imagedefault (3 files, 1 directory)
Files folder imageo2k7 (5 files, 1 directory)

  Files folder image Files (156)  /  tiny_mce  /  themes  /  advanced  /  skins  /  default  
File Role Description
Files folder imageimg (6 files)
  Plain text file content.css Aux. tinymce css file
  Plain text file dialog.css Aux. tinymce css file
  Plain text file ui.css Aux. tinymce css file

  Files folder image Files (156)  /  tiny_mce  /  themes  /  advanced  /  skins  /  default  /  img  
File Role Description
  Image file buttons.png Icon tinymce image
  Image file items.gif Icon tinymce image
  Image file menu_arrow.gif Icon tinymce image
  Image file menu_check.gif Icon tinymce image
  Image file progress.gif Icon tinymce image
  Image file tabs.gif Icon tinymce image

  Files folder image Files (156)  /  tiny_mce  /  themes  /  advanced  /  skins  /  o2k7  
File Role Description
Files folder imageimg (3 files)
  Plain text file content.css Aux. tinymce css file
  Plain text file dialog.css Aux. tinymce css file
  Plain text file ui.css Aux. tinymce css file
  Plain text file ui_black.css Aux. tinymce css file
  Plain text file ui_silver.css Aux. tinymce css file

  Files folder image Files (156)  /  tiny_mce  /  themes  /  advanced  /  skins  /  o2k7  /  img  
File Role Description
  Image file button_bg.png Icon tinymce image
  Image file button_bg_black.png Icon tinymce image
  Image file button_bg_silver.png Icon tinymce image

  Files folder image Files (156)  /  tiny_mce  /  themes  /  simple  
File Role Description
Files folder imageimg (1 file)
Files folder imagelangs (1 file)
Files folder imageskins (2 directories)
  Plain text file editor_template.js Aux. tinymce js file
  Plain text file editor_template_src.js Aux. tinymce js file

  Files folder image Files (156)  /  tiny_mce  /  themes  /  simple  /  img  
File Role Description
  Image file icons.gif Icon tinymce image

  Files folder image Files (156)  /  tiny_mce  /  themes  /  simple  /  langs  
File Role Description
  Plain text file en.js Aux. tinymce js file

  Files folder image Files (156)  /  tiny_mce  /  themes  /  simple  /  skins  
File Role Description
Files folder imagedefault (2 files)
Files folder imageo2k7 (2 files, 1 directory)

  Files folder image Files (156)  /  tiny_mce  /  themes  /  simple  /  skins  /  default  
File Role Description
  Plain text file content.css Aux. tinymce css file
  Plain text file ui.css Aux. tinymce css file

  Files folder image Files (156)  /  tiny_mce  /  themes  /  simple  /  skins  /  o2k7  
File Role Description
Files folder imageimg (1 file)
  Plain text file content.css Aux. tinymce css file
  Plain text file ui.css Aux. tinymce css file

  Files folder image Files (156)  /  tiny_mce  /  themes  /  simple  /  skins  /  o2k7  /  img  
File Role Description
  Image file button_bg.png Icon tinymce image

  Files folder image Files (156)  /  tiny_mce  /  utils  
File Role Description
  Plain text file editable_selects.js Aux. tinymce js file
  Plain text file form_utils.js Aux. tinymce js file
  Plain text file mctabs.js Aux. tinymce js file
  Plain text file validate.js Aux. tinymce js file

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:3,328
This week:0
All time:1,037
This week:38Up
User Ratings User Comments (1)
 All time
Utility:58%StarStarStar
Consistency:61%StarStarStarStar
Documentation:63%StarStarStarStar
Examples:69%StarStarStarStar
Tests:-
Videos:50%StarStarStar
Overall:53%StarStarStar
Rank:2180