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,329 All time: 1,037 This week: 46Up
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

 

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

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,329
This week:0
All time:1,037
This week:46Up
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:2200