The wddxFormLibrary Library w/CF_FormWizard
Version 1.1


The wddxFormLibrary is a JavaScript-based library that will simplify the process of converting the contents of a form into a WDDX packet. The library will automatically parse through all of the elements in a form and convert the information into a structure which is stored within a centralized structure that can contain a number of different forms.

The wddxFormLibrary will also handle repopulating the form from an existing WDDX packet (created with the wddxFormLibrary function calls.) This means you can easily take snapshots of a form's content and repopulate the page without any additional server-side coding.

Because of the unique nature in which the wddxFormLibrary works, you can do a number of things very quickly, easily and most important efficiently. In a nutshell, wddxFormLibrary takes a virtual "snapshot" of the way the current form is laid out. This means that you can use it on existing forms, store the WDDX packet in the database and any time someone needs to re-edit that information, simply grab the packet back from the database and pass it back to the form. Once the user's browser loads the page, the form will automatically be returned to the way the user last left it.

The wddxFormLibrary also simplifies your server-based coding. How many times have you created a multi-part form where you have to first check for existing information, code the page, check to see if the form fields should be populated with saved information; then after the page has been submitted, you have to write all the information back to the database? This is a very time consuming process—not only in terms of coding, but in terms of the CPU processing. With wddxFormLibrary this method is a thing of the past. All you need to do is point each form's "ACTION" attribute to the next page you want data collected from, then once all the information is collected, you can store all of the information in just one step. (Note, for added precaution you could store the WDDX packet between each page and check the database just for that packet. This would protect users from losing information if their machine crashed or they close their browser on accident.)

To see the wddxFormLibrary in action, check out the examples below:

Example 1 Shows how wddxFormLibrary can be used on a single page to take a snapshot of the content, or how it can be used to collect the same information multiple times.
Example 2 Shows how wddxFormLibrary can be used on a multi-part form. Uses <CF_FormWizardTools ACTION="Flatten"> to convert the final packet into an easier to use format.
Example 3 Shows how you can use the changeForm() and getPacketArray() functions to build custom forms that allow you to edit multiple records without reloading.
Example 4 Shows you how to use the <CF_FormWizardTools ACTION="Create"> function to create default values for your forms by building a simple structure. (NOTE: The source code also includes an example of how you could retrieve a stored packet as well.)



Important! If you're upgrading from v1.0 to v1.0a (or higher), I've made a minor change to fix the problem with the hidden form name being passed with the wddxPacket. To correct the problem I had to make a minor change to the format of the JavaScript that was generated in the CF_FormWizard. If you're not using the CF_FormWizard tag, then you must change the instance of your first "myField" variable to "myPacketName". If you're using the CF_FormWizard tag to generate your code, you shouldn't have any problems.

New Features

Changes & Bug Fixes