Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
viveleroi committed Dec 15, 2011
1 parent 986b57e commit f34b3fb
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 32 deletions.
18 changes: 9 additions & 9 deletions README
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
The jquery.Formbuilder plugin is a script that allows you integrate
a jquery and php-based form-creation tool into your application.
The jquery.Formbuilder plugin is a jQuery plugin that allows you add
a form-creation, display, and basic validation tool into your application.

The API and example code has been left open for you to override, assuming that
you want complete control over how the form data is saved and loaded. However
we have provided some basic database loading/saving examples using PDO for MySQL.

Please report all issues, bugs, and feature suggestions
to: https://snowy-evening.com/botsko/jquery-form-builder/

The tool interface is constructed using form data presented in xml format
The tool interface is constructed using form data presented in JSON format
by the server. The php class assists you with storing the data,
generating the xml, generating the html form, and processing the data.
generating the json, generating the html form, and processing the data.

A demo of this version may be found at http://experiments.botsko.net/tests/formbuilder/

Use of the JSON-encoding backend requires PHP 5.2+.

Please feel free to fork the project and provide patches back.
Please let us know how you're using this product!

The source contains all example files, javascripts necessary, php files,
any documentation, and some PHPUnit unit tests for the class.


Version 0.4 - 20111215
- Removing old XML-based form loading system, moving to pure JSON
Expand All @@ -26,6 +25,7 @@ Version 0.4 - 20111215
- Incorporated a required attribute bug fix: https://snowy-evening.com/botsko/jquery-form-builder/8/
- Dumped a ton of unnecessary complexity of encoding/decoding and array vars
- Changed process() to return an array of errors, not a string
- Added sample response saves to db, only on good validation

Version 0.3.1 - 20110722
- Corrected issue with reserved words breaking support for Safari, Opera, IE
Expand Down
12 changes: 6 additions & 6 deletions example-html.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
// the $form->get_encoded_form_array() method.
include('fake-form-db-vals.php');

//$form = new Formbuilder($fake_db_vals);
//$form->render_html('example-submit.php');
$form = new Formbuilder($fake_db_vals);
$form->render_html('example-submit.php');

// OR to load a form saved to the db:

require('Formbuilder/Formbuilder_pdo.php');
$form = new Formbuilder_pdo();
$form->connect();
$form->render_html( 1, 'example-submit.php' );
//require('Formbuilder/Formbuilder_pdo.php');
//$form = new Formbuilder_pdo();
//$form->connect();
//$form->render_html( 1, 'example-submit.php' );

?>

Expand Down
12 changes: 6 additions & 6 deletions example-json.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
// the $form->get_encoded_form_array() method.
include('fake-form-db-vals.php');

//$form = new Formbuilder($fake_db_vals);
//$form->render_json();
$form = new Formbuilder($fake_db_vals);
$form->render_json();

// OR, if you're using the database extension class you can load a form
// by passing in the record id:

require('Formbuilder/Formbuilder_pdo.php');
$form = new Formbuilder_pdo();
$form->connect();
$form->render_json( 1 );
//require('Formbuilder/Formbuilder_pdo.php');
//$form = new Formbuilder_pdo();
//$form->connect();
//$form->render_json( 1 );

?>
10 changes: 5 additions & 5 deletions example-save.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
// information to automatically save everything to the database.
// You could do that like so:

require('Formbuilder/Formbuilder_pdo.php');
$form_data = isset($_POST['frmb']) ? $_POST : false;
$form = new Formbuilder_pdo($form_data);
$form->connect();
$form->save_form();
//require('Formbuilder/Formbuilder_pdo.php');
//$form_data = isset($_POST['frmb']) ? $_POST : false;
//$form = new Formbuilder_pdo($form_data);
//$form->connect();
//$form->save_form();


//------------------------------------------------------------------------------
Expand Down
12 changes: 6 additions & 6 deletions example-submit.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
// the $form->get_encoded_form_array() method.
include('fake-form-db-vals.php');

//$form = new Formbuilder($fake_db_vals);
//$results = $form->process();
$form = new Formbuilder($fake_db_vals);
$results = $form->process();

// OR you can process form based on the one stored in the db

require('Formbuilder/Formbuilder_pdo.php');
$form = new Formbuilder_pdo();
$form->connect();
$results = $form->save_response(1);
//require('Formbuilder/Formbuilder_pdo.php');
//$form = new Formbuilder_pdo();
//$form->connect();
//$results = $form->save_response(1);

// At this point though, there are a few choices to save this to a DB
// It's harder to store the values because the fields change and are more
Expand Down

0 comments on commit f34b3fb

Please sign in to comment.