Recommend this page to a friend! |
Download |
Info | Documentation | Demos | Screenshots | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2024-11-09 (28 days ago) | 81% | Total: 88,853 This week: 2 | All time: 1 This week: 27 |
Version | License | PHP version | Categories | |||
formsgeneration 1.0.47 | BSD License | 4 | HTML, Validation, AJAX |
Description | Author | ||||||||
Class that generates HTML forms supporting: |
|
secure registration and login forms
I want a secured registration form and login form
Recommendation for a PHP class to upload large files in chunks
Upload large files in chunks checking progress
What is the best PHP textarea editor class?
Textarea needed with all editor options
AJAX functions to update page elements
I need to be able to use a set of generic AJAX function calls
PHP API Key Generator
A random API key generator to server as access restriction to AP
mlm dynamic binary tree code in PHP and MySQL
mlm dynamic binary tree
PHP Navigation bar with CodeIgniter
Problem with the URL
Dynamic class for CRUD with MySQL database
Form processing to MySQL database storage
What is the best PHP grid crud postgresql class?
Class to enable browsing a PostgreSQL database
Spell check for PHP
I need to check textareas
Price checking availability using barcode scanner by mobile apps
Example source code in barcode scanner
Reading changed check boxes
Need to read changes in check boxes
dropdown dependency
i need the code and explation of dropdown dependency
What is the best PHP youtube video downloader class?
Download videos from YouTube
What is the best PHP responsive forms generator class?
Responsive forms with all kind of elements (date, text, etc.)
Form validation + form generation + mysqli query+security filter
Make a CMS from simple class
Remote PHP app to alter database
I need to manipulate a MySQL database on my website with browser
What is the best PHP AJAX file upload class?
I want to upload files using AJAX
What is the best PHP tab based forms class?
Design a data entry form with tabs
Large file upload handler
Looking for class that will handle large file uploads
Create file structure based on text string
Need to dynamically create a file system structure on the fly
What is the best PHP data validation classes class?
Customer details form validation like phone and email
What is the best PHP multiple tabs form class?
I want to use form with multiple tabs and validations
Could you suggest a good form validator?
I need a RAD form validator
Vectorize a map in defined points
I need to vectorize points in a geographical map image
Form Listview with dependent field
I need to create a form using dependent listboxes
Filtration mechanism
Filtration mechanism in shopping portal
How to create related dropdown list box?
cannot link 2nd dropdown list box with first one
Job application form
Single form to be feed by applicant for the job
how to make
large form handle design pattern
I need php class which converts word format to html
I need php class which converts word format to html
Implement image CAPTCHA validation
a class to implement image captcha via an Ajax request
What is the best PHP crud class?
Basic insert, update, list, delete with pagination and images
Include the forms class directly or use vendor/autoload.php if you install it with composer.
require("forms.php");
Create a form object.
$form=new form_class;
Define the name of the form to be used for example in Javascript validation code generated by the class.
$form->NAME="subscription_form";
Use the GET method if you want to see the submitted values in the form processing URL, or POST otherwise.
$form->METHOD="POST";
Make the form be displayed and also processed by this script.
$form->ACTION="";
Specify a debug output function you really want to output any programming errors.
$form->debug="trigger_error";
Define a warning message to display by Javascript code when the user attempts to submit the this form again from the same page.
$form->ResubmitConfirmMessage=
"Are you sure you want to submit this form again?";
Output previously set password values.
$form->OutputPasswordValues=1;
Output multiple select options values separated by line breaks
$form->OptionsSeparator="<br />\n";
Output all validation errors at once.
$form->ShowAllErrors=1;
CSS class to apply to all invalid inputs. Set to a non-empty string to specify the invalid input CSS class
$form->InvalidCLASS='invalid';
Style to apply to all invalid inputs when you just want to override a few style attributes, instead of replacing the CSS class. Set to a non-empty string to specify the invalid input style attributes
$form->InvalidSTYLE='background-color: #ffcccc; border-color: #000080';
Text to prepend and append to the validation error messages.
$form->ErrorMessagePrefix="- ";
$form->ErrorMessageSuffix="";
Define the form field properties even if they may not be displayed.
$form->AddInput(array(
"TYPE"=>"text",
"NAME"=>"email",
"ID"=>"email",
"MAXLENGTH"=>100,
"Capitalization"=>"lowercase",
"ValidateAsEmail"=>1,
"ValidationErrorMessage"=>"It was not specified a valid e-mail address.",
"LABEL"=>"<u>E</u>-mail address",
"ACCESSKEY"=>"E"
));
$form->AddInput(array(
"TYPE"=>"submit",
"ID"=>"button_subscribe",
"VALUE"=>"Submit subscription",
"ACCESSKEY"=>"u"
));
Load form input values eventually from the submitted form.
$form->LoadInputValues($form->WasSubmitted("doit"));
Empty the array that will list the values with invalid field after validation.
$verify=array();
Check if the was submitted as opposed to being displayed for the first time.
if($form->WasSubmitted())
{
Therefore we need to validate the submitted form values.
if(($error_message=$form->Validate($verify))=="")
{
It's valid, set the $doit flag variable to 1 to tell the form is ready to processed.
$doit=1;
}
else
{
It's invalid, set the $doit flag to 0 and encode the returned error message to escape any HTML special characters.
$doit=0;
$error_message=nl2br(HtmlSpecialChars($error_message));
}
}
else
{
The form is being displayed for the first time, so it is not ready to be processed and there is no error message to display.
$error_message="";
$doit=0;
}
if($doit)
{
The form is ready to be processed, just output it again as read only to display the submitted values. A real form processing script usually may do something else like storing the form values in a database.
$form->ReadOnly=1;
}
If the form was not submitted or was not valid, make the page ONLOAD event give the focus to the first form field or the first invalid field.
if(!$doit)
{
if(strlen($error_message))
{
If there is at least one field with invalid values, get the name of the first field in error to make it get the input focus when the page is loaded.
Reset($verify);
$focus=Key($verify);
}
else
{
Make the email field get the input focus when the page is loaded if there was no previous validation error.
$focus='email';
}
Connect the form to the field to get the input focus when the page loads.
$form->ConnectFormToInput($focus, 'ONLOAD', 'Focus', array());
}
$onload = HtmlSpecialChars($form->PageLoad());
?><!DOCTYPE>
<html>
<head>
<title>Test for Manuel Lemos' PHP form class</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<style type="text/css"><!--
.invalid { border-color: #ff0000; background-color: #ffcccc; }
// --></style>
</head>
<body onload="<?php echo $onload; ?>" bgcolor="#cccccc">
<h1>Test for Manuel Lemos' PHP form class</h1>
<hr />
Compose the form output by including a HTML form template with PHP code interleaaved with calls to insert form input field parts in the layout HTML.
$form->StartLayoutCapture();
$title="Form class test";
$body_template="form_body.html.php";
require("templates/form_frame.html.php");
$form->EndLayoutCapture();
Output the form using the function named Output.
$form->DisplayOutput();
?></body>
</html>
All examples | AJAX form submission | Auto Complete | Form CRUD | General Example | Google Maps integration | Linked select inputs | Maps | Multiple Tabs | AJAX Form Submission |
Screenshots (8) | ||
Videos (2) | ||
Slides (2) | ||
Files (149) |
File | Role | Description | ||
---|---|---|---|---|
smarty (2 directories) | ||||
templates (25 files) | ||||
test (1 file, 2 directories) | ||||
test_form.php | Example | Forms class test page script | ||
forms.html | Doc. | Forms class documentation in HTML format | ||
animation.js | Data | Javascript class to use with the page element animation plug-in | ||
blog_post_data_source.php | Class | Blog post data source class for the crude example script | ||
blog_post_model.php | Class | Example blog post model class for the scaffolding example script | ||
blog_post_view.php | Class | Example Blog post presentation definition class for the scaffolding example | ||
classmaps.php | Aux. | Define an array with all package class files | ||
country_codes.php | Aux. | Country codes definitions for the maps example | ||
forms.php | Class | Forms class file | ||
form_ajax_submit.php | Class | Custom plug-in class to submit forms with AJAX to not need to reload the page | ||
form_animation.php | Class | Page element animation plug-in | ||
form_auto_complete.php | Class | Custom plug-in class to auto-complete text entered in text inputs | ||
form_captcha.php | Class | Custom input plug-in class for implementing CAPTCHA tests to prevent robots access allowing only humans | ||
form_crud.php | Class | Custom input to handle scaffolding CRUD events by accessing data source objects. | ||
form_custom_validation.php | Class | Example plug-in class to demonstrate how to perform new arbitrary validation types | ||
form_date.php | Class | Custom input plug-in class for editing calendar dates | ||
form_file_edit.php | Class | File edit plugin class | ||
form_html_editor.php | Class | HTML editor plug-in input class | ||
form_layout_paged.php | Class | Custom container input class to layout inputs in tabbed pages | ||
form_layout_vertical.php | Class | Custom container plug-in class to render a group of inputs automatically without separate HTML or templates | ||
form_linked_select.php | Class | Custom linked select input class | ||
form_list_select.php | Class | Custom list select input class | ||
form_map_location.php | Class | Custom input plug-in class for implementing a world map location selection input using Google Maps API | ||
form_mdb2_auto_complete.php | Class | Custom auto complete input class using database queries with PEAR::MDB2 API | ||
form_mdb2_linked_select.php | Class | Custom linked select input class that retrieves options from a database with the PEAR::MDB2 API adapted by Lukas Smith | ||
form_metabase_auto_complete.php | Class | Custom plug-in class to auto-complete text entered in text inputs that retrieves completion texts dynamically from a database using the Metabase API | ||
form_metabase_linked_select.php | Class | Custom linked select input plug-in class that retrieves options from a database with the Metabase API | ||
form_mysqli_auto_complete.php | Class | Custom auto complete input class using MySQL database queries using MySQLi | ||
form_mysqli_linked_select.php | Class | Custom linked select input class that retrieves options from a MySQL database using MySQLi | ||
form_mysql_auto_complete.php | Class | Custom plug-in class to auto-complete text entered in text inputs that retrieves completion texts dynamically from a MySQL database | ||
form_mysql_linked_select.php | Class | Custom linked select input plug-in class that retrieves options from a MySQL database | ||
form_recaptcha.php | Class | reCAPTCHA custom input class | ||
form_scaffolding.php | Class | Custom container input to manage scaffolding forms | ||
form_secure_submit.php | Class | Secure form submit input plug-in class to prevent CSRF attacks | ||
form_upload_progress.php | Class | Custom plug-in class to monitor the progress of upload of a form with files and show a progress bar | ||
html_editor.js | Data | HTML editor Javascript class | ||
indicator.gif | Icon | AJAX load indicator animation icon | ||
locations.schema | Data | Locations database schema definition in format for the Metabase linked select inputs example | ||
locations.sql | Data | Locations MySQL database schema dump for the linked select inputs example | ||
markerclusterer.js | Data | MarkerClusterer Javascript class by Xiaoxi Wu | ||
md5.js | Data | Henri Torgemane's Javascript md5 encoding function | ||
noise.gif | Data | Example of noise GIF image to obfuscate the CAPTCHA input images | ||
noise.png | Data | Example of noise PNG image to obfuscate the CAPTCHA input images | ||
progress.gif | Icon | Upload progress bar stripe background image | ||
pulldown.gif | Icon | Pulldown menu button icon image | ||
README.md | Doc. | Description | ||
rfc1867.php-4.3.11.patch | Data | Patch to enable upload progress monitoring in PHP 4.3.11 | ||
rfc1867.php-4.4.4.patch | Data | Patch to enable upload progress monitoring in PHP 4.4.4 | ||
rfc1867.php-4.4.9.patch | Data | Patch to enable upload progress monitoring in PHP 4.4.9 (use patch -p0 to apply) | ||
setup_locations_database.php | Aux. | Script to install the locations database schema definition in format for the Metabase linked select inputs example | ||
test_age_date_input.php | Example | Example to demonstrate how to use the custom date input with the ask age option | ||
test_ajax_form.php | Example | Example to show how to define and process a form with AJAX submit plug-in | ||
test_animation.php | Example | Example to demonstrate how to use the animation plug-in | ||
test_animation_page.html | Output | Test HTML page generated by the class using test_animation.php script | ||
test_auto_complete.html | Output | Test HTML page generated by the class using test_auto_complete.php script. | ||
test_auto_complete.php | Example | Example to show how to use the auto-complete text custom input plug-in | ||
test_auto_layout_form.php | Example | Example to show how to render a inputs with the automatic vertical layout plug-in | ||
test_captcha_input.php | Example | Example to demonstrate how to use the custom CAPTCHA input plug-in | ||
test_captcha_input_page.html | Output | Test HTML page generated by the class using test_captcha_input.php script. | ||
test_crud_input.php | Class | Example to demonstrate how to use the scaffolding and crud inputs together | ||
test_custom_validation.php | Example | Example to demonstrate how to use the custom validation plug-in | ||
test_date_input.php | Example | Example to demonstrate how to use the custom date input plug-in | ||
test_date_input_page.html | Output | Test HTML page generated by the class using test_date_input.php script. | ||
test_dependent_validation.php | Example | Example to demonstrate how validate inputs depending on the state of a checkbox | ||
test_encoded_password.php | Example | Example of password encoding before form submission | ||
test_form_page.html | Output | Test HTML page generated by the class using test_form.html script. | ||
test_form_results_page.html | Output | Test HTML results page generated by the class using test_form.html script. | ||
test_html_editor.php | Example | Example to demonstrate how to use the HTML editor custom input | ||
test_javascript_string_escaping.php | Test | Test script to verify the generation of escaped Javascript strings | ||
test_linked_select.php | Example | Example to demonstrate how to link multiple select inputs | ||
test_linked_select_page.html | Output | Test HTML page generated by the class using test_linked_select_input.php script. | ||
test_list_select.php | Example | Example to demonstrate the list select input | ||
test_map_location_input.php | Example | Example to demonstrate how to use the Google Maps map location custom input plug-in | ||
test_mdb2_auto_complete.php | Example | Example to demonstrate how to auto-complete a text input with texts from a database using PEAR::MDB2 API | ||
test_mdb2_linked_select.php | Example | Example to demonstrate how to link multiple select inputs retrieving options from a database with the PEAR::MDB2 API adapted by Lukas Smith | ||
test_metabase_auto_complete.php | Example | Example to show how to use the auto-complete text custom input plug-in retrieving auto-complete texts from a database using the Metabase API | ||
test_metabase_linked_select.php | Example | Example to demonstrate how to link multiple select inputs retrieving options from a database with the Metabase API | ||
test_mysqli_auto_complete.php | Example | Example to demonstrate how to auto-complete a text input with texts from a MySQL database using MySQli | ||
test_mysqli_linked_select.php | Example | Example to demonstrate how to link multiple select inputs retrieving options from a MySQL database using MySQLi | ||
test_mysql_auto_complete.php | Example | Example to show how to use the auto-complete text custom input plug-in retrieving auto-complete texts from a MySQL database | ||
test_mysql_linked_select.php | Example | Example to demonstrate how to link multiple select inputs retrieving options from a MySQL database | ||
test_paged_layout_form.php | Example | Forms class example to render a inputs in tabbed pages with the paged layout plug-in | ||
test_recaptcha_input.php | Example | Example to demonstrate how to use the reCAPTCHA custom input | ||
test_scaffolding_input.php | Example | Example to demonstrate how to use the scaffolding input | ||
test_secure_submit.php | Example | Example to demonstrate how use the secure submit custom input to prevent CSRF attacks | ||
test_smarty3_form.php | Example | Forms class test page using Smarty 3 plug-in filter | ||
test_smarty_form.php | Example | Forms class test page using Smarty 2 plug-in filter | ||
test_upload.php | Example | File uploading example. | ||
test_upload_progress.php | Example | Example to show how to use the form upload progress custom input plug-in |
Files (149) | / | smarty | / | 2 | / | plugins |
File | Role | Description |
---|---|---|
insert.formadddatapart.php | Aux. | Smarty plug-in script to insert form data parts |
insert.formaddinputhiddenpart.php | Aux. | Smarty plug-in script to insert form input as hidden parts |
insert.formaddinputpart.php | Aux. | Smarty plug-in script to insert form input parts |
insert.formaddlabelpart.php | Aux. | Smarty plug-in script to insert form input label parts |
prefilter.form.php | Aux. | Smarty 2 engine pre-filter plugin for form template processing |
Files (149) | / | smarty | / | 2 | / | templates_c |
File | Role | Description |
---|---|---|
.htaccess | Data | Apache configuration file to forbid access to all files in this directory. This file is meant mostly to force the creation Smarty compiled templates directory templates_c. |
Files (149) | / | smarty | / | 3 | / | plugins |
File | Role | Description |
---|---|---|
insert.formadddatapart.php | Aux. | Smarty 3 plug-in script to insert form data parts |
insert.formaddinputhiddenpart.php | Aux. | Smarty 3 plug-in script to insert form input as hidden parts |
insert.formaddinputpart.php | Aux. | Smarty 3 plug-in script to insert form input parts |
insert.formaddlabelpart.php | Aux. | Smarty 3 plug-in script to insert form input label parts |
prefilter.form.php | Aux. | Smarty 3 engine pre-filter plugin for form template processing |
Files (149) | / | smarty | / | 3 | / | templates_c |
File | Role | Description |
---|---|---|
.htaccess | Data | Apache configuration file to forbid access to all files in this directory. This file is meant mostly to force the creation Smarty compiled templates directory templates_c. |
Files (149) | / | templates |
File | Role | Description |
---|---|---|
footer.tpl | Data | Example page footer Smarty template |
form.tpl | Data | Smarty HTML template for composing example form (copy to your Smarty templates directory) |
formerror.tpl | Data | Smarty template for displaying validation errors in the example form |
form_age_body.html.php | Aux. | Date custom input with the ask age option form body template |
form_ajax_body.html.php | Aux. | HTML template with embedded PHP to define the form body for the AJAX submit example |
form_animation.html.php | Aux. | Animation plug-in form template |
form_auto_complete_body.html.php | Aux. | HTML template with embedded PHP to define the form body for auto-complete text custom input plug-in |
form_auto_layout_body.html.php | Aux. | Template script to render the inputs of the automatic layout custom input plug-in |
form_body.html.php | Aux. | HTML template with embedded PHP to define the form body |
form_captcha_body.html.php | Aux. | CAPTCHA custom input form body template |
form_custom_validation.html.php | Aux. | Custom validation form body template |
form_date_body.html.php | Aux. | Date custom input form body template |
form_dependent_validation.html.php | Aux. | Dependent validation form body template |
form_frame.html.php | Aux. | HTML template with embedded PHP to define the form frame |
form_linked_select_body.html.php | Aux. | Linked selects form body template |
form_list_select_body.html.php | Aux. | List select input example form body template |
form_locations_aut...plete_body.html.php | Aux. | Auto-complete location input example form body template |
form_map_location_body.html.php | Aux. | Google Maps map location custom input form body template |
form_paged_layout_body.html.php | Aux. | Template script to render the inputs of the paged layout custom input plug-in |
form_password_body.html.php | Aux. | Encoded password form body template |
form_recaptcha_body.html.php | Example | RECAPTCHA custom input form body template |
form_upload_body.html.php | Aux. | Upload file form body template |
header.tpl | Data | Example page header Smarty template |
message.html.php | Data | HTML template with embedded PHP to display a message feedback window |
mypage.tpl | Data | Example page wide Smarty template that integrates the form template output |
Files (149) | / | test |
Files (149) | / | test | / | expect |
File | Role | Description |
---|---|---|
all_client_errors_...date_input.php.html | Data | Expected output of the test_age_date_input.php script |
all_client_errors_...validation.php.html | Data | Expected output of the test_custom_validation.php script |
all_client_errors_...date_input.php.html | Data | Expected output of the test_date_input.php script |
all_client_errors_test_form.php.html | Data | Expected output of the test_form.php script showing all client validation errors |
all_server_errors_test_form.php.html | Data | Expected output of the test_form.php script after processing server validation showing all errors |
server_test_form.php.html | Data | Expected output of the test_form.php script after processing server validation errors |
set_age_date_test_date_input.php.html | Data | Expected output of the setagedate test |
set_date_test_date_input.php.html | Data | Expected output of the setdate text |
test_age_date_input.php.html | Data | Expected output of the test_age_date_input.php script |
test_custom_validation.php.html | Data | Expected output of the test_custom_validation.php script |
test_date_input.php.html | Data | Expected output of the test_date_input.php script |
test_form.php.html | Data | Expected output of the test_form.php script |
test_javascript_string_escaping.php.txt | Data | Expected ouput of the test to verify the escaping of Javascript strings. |
Files (149) | / | test | / | generated |
File | Role | Description |
---|---|---|
.cvsignore | Data | Dummy file to force the generated directory creation |
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 |
formsgeneration-2024-11-09.zip 547KB | |
formsgeneration-2024-11-09.tar.gz 466KB | |
Install with Composer |
Needed packages | ||
Class | Download | Why it is needed | Dependency |
---|---|---|---|
Metabase | .zip .tar.gz | Used by the custom linked select plug-in class that retrieves groups of options from many SQL databases | Conditional |
Version Control | Reuses | Unique User Downloads | Download Rankings | ||||||||||||||||
88% | 14 |
|
|
User Ratings | User Comments (20) | |||||||||||||||||||||||||||||||
|
Applications that use this package |
Used to generate forms in this site about training dogs |
If you know an application of this package, send a message to the author to add a link here.
Other classes that need this package |
Class | Why it is needed | Dependency |
---|---|---|
CRUD Class | for generate the forms | Required |
Database access class | Retrieve values of processed form fields | Required |
Date and time utility class | Generates forms with the fields defined by this class | Required |
Ezmlm mailing list manager class | Generate and process forms for creating and editing the mailing lists | Required |
FCKEditor Plug-in | This is a plug in for Manuel Lemos' forms class | Required |
General Validation | This is main class which includes functions for validating | Recommended |
Multipage forms class | Generates and validates the forms | Required |
Navelo CMS | Helping to generate all form in CMS | Required |
Niger | the package is compulsory | Required |
PHP Webmaster Tools API | Present the user interface to configure the options to retrieve the top searched pages | Conditional |
PHPBB Db Tools | PHPBB MySQL Db Tools 1 | Required |
Plugin Cal class | This is the main class | Required |
Secure HTML parser and filter | Used in the secure_html_filter.php Web interface test script | Conditional |
Xinha plug-in | This is the main forms generation and validation class that this plug-in extends | Required |
Related pages |
Pages that reference this package |