PHP Classes
elePHPant
Icontem

Rapid Form Builder: Show and process database access forms using AJAX

Recommend this page to a friend!
  Info   Screenshots Screenshots   View files View files (10)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2009-04-09 (7 years ago) RSS 2.0 feedStarStarStar 50%Total: 2,801 All time: 1,297 This week: 1,016Up
Version License PHP version Categories
rapidformbuilder 0.1GNU General Publi...5.0HTML, PHP 5, Databases, AJAX
Description Author

This package can be used to show and process database access forms using AJAX.

There is one class that can generate HTML and Javascript to display form fields and have them validated immediately after the field values are changed.

Another class can validated and process the forms submitted via AJAX to update MySQL database records according to mappings also stored in the database.

Picture of chris
Name: chris <contact>
Classes: 1 package by
Country: Canada Canada

Details
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
Screenshots  
  • rapidFormBuilder.jpeg
  Files folder image Files  
File Role Description
Files folder imagecss (1 file)
Files folder imageimages (1 file)
Files folder imagejavascript (1 file)
Plain text file ajaxForms.sql Data sample database for the AJAX
Plain text file check.php Example Part of the example.
Plain text file checkClasses.php Class The classes that do the actual work
Plain text file example.php Example Example script for the class
Plain text file presentationLayer.php Class Class reponsible for drawing the form
Plain text file readme.txt Doc. Readme for new developers
Plain text file tinyExample.php Example The tiniest example just for noobs. We were all there once.

  Files folder image Files  /  css  
File Role Description
  Plain text file style.css Data css for the example

  Files folder image Files  /  images  
File Role Description
  Image file greenCheckMark.gif Icon used in the css to show that a field was validated properly

  Files folder image Files  /  javascript  
File Role Description
  Plain text file ajaxforms.js Data javascript for the AJAX

 Version Control Unique User Downloads Download Rankings  
 0%
Total:2,801
This week:0
All time:1,297
This week:1,016Up
 User Ratings  
 
 All time
Utility:70%StarStarStarStar
Consistency:60%StarStarStarStar
Documentation:50%StarStarStar
Examples:45%StarStarStar
Tests:-
Videos:-
Overall:50%StarStarStar
Rank:2052