R A P I D
F O R M
B U I L D E R
version 0.1 beta
* created by: Christopher Knott, chris@digitalLight.ca http://digitalLight.ca
* Thanks to those who made tutorials or published code.
What is Rapid Form Builder?
---------------------------
Rapid Form Builder allows developers to build web forms with only 1 line of php code.
The focus of Rapid Form Builder is speed of development, usability for end users, and accessibility. Rapid Form Builder is written in AJAX / PHP / MySQL.
Submissions are made through AJAX so that feedback can be instant and meaningful. With a single line of code, and these instructions, beginning programmers can rapidly build new forms for use on their websites. This should greatly improve the speed of development, and also create powerful, accessible, and usable forms.
How does it work?
-----------------
A text field is defined and presented like this:
<?php echo $displayField->displayField(txt1_username, 0, 20, "", 1, $sid); ?>
Simply include that line within a form (with a database configured)
Thats It!
Are there more details to know?
-------------------------------
Of course, but not many. This line will now be explained in more depth:
<?php echo $displayField->displayField(usr1_username, 0, 20, "", 1, $sid); ?>
<?php -- start the php tag. if you are lost here, you need to learn the basics first!
echo: -- simple PHP display command
$displayfield->displayField -- refers to which object, and which method. please see the checkClasses.php page
txt -- "txt" refers to the type of validation required. please see the below listing of defined types. others can be quickly created. e.g. Postal Code
1_ -- 1 is for Mandatory fields. 0 is for not mandatory. used for the class determination. underscore is just for readability
0 -- defines the accessiblity position used for the label. this allows for keyboard selection of which field is to be selected for editing (by the user)
20 -- the length of the field to be displayed
"" -- if there is one, then the default value for the field will be shown. if there already is data in teh database,then this will be overwritten
1 -- tab index. simple html stuff
$sid -- pass the session ID along to the rest of the methods
?> -- closes the PHP tag.
What are the current validation types?
--------------------------------------
*** dat = data. contains numbers only
*** alp = alpha. contains only letters
*** aln = alphanumeric. numbers and letters only
*** txt = no real requirements unless in the database
*** eml = email
What are the error messages displayed?
--------------------------------------
Error Message Colour Coding
Red = Mandatory and failed validation
Black = optional but failed validation
Green Check Mark = passed Validation
Why is there a table in the database called tableMappings?
----------------------------------------------------------
To provide a flexible solution that will work with large databases, this is required. Also, this attempts to provide a measure of security so that the field names do not relate to database tables. Additionally, extra information may be stored in the database to make the class more extendable.
How do the files included in this work?
---------------------------------------
example.php -- i hate it when people write classes but dont explain them, or give an example of how to use them. so... just run this file on a LAMP / WAMP / MAMP server with the required database.
presentationLayer.php -- displays the form based on what is supplied by example.php and the css. adds any default / known values where appropriate.
ajaxForms.js -- very few changes from the original supplied by Hatem B.Y. Please see the file for more comments. Thanks Hatem.
check.php -- ajaxForms.js submis the data to this file. from here, the values are retrieved, and simple redirections take place
checkClasses.php -- the guts of the application. this does the heavy lifting. does the database lookups, handles all the validation
form_v.php -- if the submit button is pressed... this will handle any post-submit processing
page2.php -- the next page in teh site, or any congratulations page, etc
ajaxForms.sql -- use this to create the initial testing database
tinyExample.php -- super tiny example. just to really dumb it down (contains comments)
I hope this is more than enough to get a newbie up to speed with how to implement Rapid Form Builder. If you are stuck on the database stuff, then please install phpMyAdmin. It will answer all your questions.
For any questions, please reach out to:
Christopher Knott
chris@digitalLight.ca
http://digitalLight.ca |