Permalink
Browse files

cleanup work, html5

  • Loading branch information...
viveleroi committed Jun 21, 2011
1 parent d0437ec commit 33b2f36f61e0dd925055d6bc37ebc9bf2da1f3e5
Showing with 27 additions and 32 deletions.
  1. +3 −1 README
  2. +9 −8 docs/DOCUMENTATION
  3. +3 −4 example-html.php
  4. +3 −4 example-submit.php
  5. +9 −15 index.html
View
4 README
@@ -10,13 +10,14 @@ generating the xml, 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.
-
Note: Currently, an upgrade to jQuery 1.4.2 will not be enabled until
problems with the scroll.to plugin are resolved.
@@ -29,6 +30,7 @@ Version 0.3-beta - 20110619
- Improved dynamic loading, unique ID handling for multiple formbuilder-instances
- Removed scrollTo dependency in favour of jQuery.animate()
- Added json backend, to replace/as alternative to xml
+- Example html switched to latest html doctype
Version 0.2 - 20100806
- Upgraded to scroll.to 1.4.2
View
@@ -7,15 +7,14 @@ a bit more details in this document. Please let us know
if anything needs to be corrected.
-
Including Javascript
------------------------------------------
The first step is to include the proper javascript files.
- <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
- <script type="text/javascript" src="js/jquery.scrollTo-min.js"></script>
- <script type="text/javascript" src="js/jquery.formbuilder.js"></script>
+ <script src="//code.jquery.com/jquery-latest.min.js"></script>
+ <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js"></script>
+ <script src="js/jquery.formbuilder.js"></script>
Then, you need to activate the form builder class on a single div within your page.
@@ -27,7 +26,7 @@ The load url is the relative/absolute address that will provide the xml response
for loading.
<script type="text/javascript">
- $(document).ready(function(){
+ $(function(){
$('#form-builder').formbuilder({
'save_url': 'example-save.php',
'load_url': 'example-load.php'
@@ -73,13 +72,15 @@ format.
Loading for Jquery Form
--------------------------------
-The jquery plugin is awaiting for xml, so by calling the following methods
-you will generate the right xml. You need to pass the hash and form structure
-saved in your database as an array, just as it was saved.
+The jquery plugin is awaiting xml or JSON. You need to pass the hash and
+form structure saved in your database as an array, just as it was saved.
$form = new Formbuilder($fake_db_vals);
$form->render_xml();
+ or
+
+ $form->render_json();
Render Form HTML
View
@@ -1,9 +1,8 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<!DOCTYPE html>
+<html>
<head>
<title>jQuery FormBuilder Demo (Output)</title>
- <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+ <meta charset="utf-8" />
</head>
<body>
View
@@ -1,9 +1,8 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<!DOCTYPE html>
+<html>
<head>
<title>jQuery FormBuilder Demo (Submission)</title>
- <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+ <meta charset="utf-8" />
</head>
<body>
View
@@ -1,19 +1,17 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<!DOCTYPE html>
+<html>
<head>
<title>jQuery FormBuilder Demo</title>
- <meta http-equiv="content-type" content="text/html; charset=utf-8" />
-
- <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js"></script>
- <script type="text/javascript" src="js/jquery.formbuilder.js"></script>
- <link href="css/jquery.formbuilder.css" media="screen" rel="stylesheet" type="text/css" />
+ <meta charset="utf-8" />
+ <script src="//code.jquery.com/jquery-latest.min.js"></script>
+ <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js"></script>
+ <script src="js/jquery.formbuilder.js"></script>
+ <link href="css/jquery.formbuilder.css" media="screen" rel="stylesheet" />
<style type="text/css">
a, body { font-family: "Tahoma", "Verdana", sans-serif; font-size: 12px; }
</style>
- <script type="text/javascript">
- $(document).ready(function(){
+ <script>
+ $(function(){
$('#my-form-builder').formbuilder({
'save_url': 'example-save.php',
'load_url': 'example-json.php',
@@ -24,14 +22,10 @@
});
});
</script>
-
</head>
<body>
-
<h1>jQuery Form Builder Plugin Demo</h1>
-
<p><a href="example-html.php">View sample rendered html</a>.</p>
-
<div id="my-form-builder"></div>
</body>
</html>

0 comments on commit 33b2f36

Please sign in to comment.