jFormer DocumentationjFormer Structure

jFormer

JFormer(String id, [, Array optionArray])

The jFormer object is the wrapper and controller for all parts of the form, any of its options are those that either effect the entire functionality of the form itself, or effect every component within it.

Usage

Constructor

    new JFormer(String id, [, Array optionArray])
    

Sample Usage

Create a simple form with a title and change the default submit button text:

    $sampleForm = new JFormer('id', array(
        'submitButtonText' => 'Submit 
        'title' => '

Sample Usage Object

', ));

jFormer Options

These options are specific to the JFormer object.

Option Name Default Value

debug_backtrace()

action

path as a string | This is the action of the form, it should point back to the PHP file that created the form, so you can validate your form and access your onSubmit funciton. if you change it, make sure it is the path to the correct file.

"onSubmit"

onSubmitFunctionServerSide

string | The name of the function that processes the form, see Processing Submissions for more information

"Submit"

submitButtonText

string | The text that shows up on the submit button of the form (remember that if you have multiple pages this will only show up on the final page of the form, other pages will have the text "next")

"Processing..."

submitProcessingButtonText

string | The text that shows up on the submit button while the form is processing server side (only shows up after you click the submit button and the form is processing)

true

alertsEnabled

boolean | If enabled, will allow jformer alerts to show up when called (see jFormer Alterts Page for more information on alerts

true

clientSideValidation

boolean | If disabled, turns off the javascript validation of components, useful for debugging.

false

debugMode

boolean | If enabled, the submit button is not disabled while the form is processing to prevent multiple submissions, and the iframe that submits the form is set to display:block

true

validationTips

boolean | If disabled, tip content will not be updated with validation errors when validating. validation will still occur

false

pageNavigator

boolean | If pageNavigator is true, it enables the page navigator for multipage forms, rather than a boolean you can also submit an options object to change the defaults for this, see the pageNavigator page for more information.

false

splashPage

boolean | If splashPage is true, it enables the splash page, a landing page for your form, rather than a boolean you can also submit an options object to change the defaults for this, see the splashPage page for more information.

NameDefault ValueDescription

jFormer PHP Methods

These Methods are specific to the JFormer object. for building the form, (PHP only)

->addJFormPage(Object)

Object | jFormPage Object the jFormPage to add to jFormer.

Adds a page to the jFormer Object.

->addJFormPages(Array)

Array | jFormPage Objects the jFormPage to add to jFormer.

Adds an array of pages to the jFormer Object.

->addJFormSection(Object)

Object | jFormSection Object the jFormPage to add to jFormer.

Adds a section directly to the jFormer Object. Rather than the section being added to the page, an 'anonymous' jFormPage object is created for the section to be added to.

->addJFormComponent(Object)

Object | jFormComponent Object the jFormPage to add to jFormer.

Adds a component directly to the jFormer Object. Rather than the component being added to a section, an 'anonymous' jFormSection object is created for the section to be added to.

->addJFormComponentArray(Array)

Array | jFormComponent Objects the jFormPage to add to jFormer.

Adds a component directly to the jFormer Object. Rather than the component being added to a section, an 'anonymous' jFormSection object is created for the section to be added to.

jFormer Javascript Methods

These Methods are specific to the JFormer object. for customizing the form, (Javascript only)

.checkDependencies()

Checks all dependencies on the form, if a component has a dependepency, those conditions will be checked.

.select(String)

String | The ID of the jFormComponent you wish to select.

Searches the form for the specific jFormComponent by ID. Returns a jFormComponent Object, or false if the Object is not found.

.getData()

Gathers the values of all components from the form and places them in a JSON object. returns JSON Object.

.setData(Object)

Object | Object of values to be set.

set the values of all components in the form from the object . returns JSON Object.

Next Page: jFormPage

This page was last edited on April 22, 2011 at 4:13am.