FormBuilderForm class

This stores all of the configuration data for a form and maintains FormBuilderField objects for the fields of the form.

It is also an intermediary between the a form array and an InputfieldForm. Please note that there are no hookable methods in this class.

// Loading a form
$form = $forms->load('form-name'); 

Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the FormBuilderForm class also inherits all the methods and properties of: FormBuilderField and FormBuilderData.

Show class?     Show args?       Only hookable?    

Retrieval

NameReturnSummary 
FormBuilderForm::exists(string $name)
boolDoes field with this name exist in the form? 

Pages

NameReturnSummary 
FormBuilderForm::savePageFields array Map of [ 'page field ID' => 'form field name' ] to translate page fields to/from form fields.  
FormBuilderForm::savePageParent int Parent ID of page when saving form entries to pages  
FormBuilderForm::savePageStatus int Page status (int) to use for newly created pages.  
FormBuilderForm::savePageSubfields string Multi-line text with form_field=page_field or form_field=page_field.subfield at one per line.  
FormBuilderForm::savePageTemplate int ID of page template when saving form entries to pages  

Output

NameReturnSummary 
FormBuilderForm::backText string Default “back” button text  
FormBuilderForm::errorMessage string Message to display if form has errors  
FormBuilderForm::nextText string Default “next” button text  
FormBuilderForm::render()
stringRender this form's output and/or process if it has been posted. 
FormBuilderForm::submitText string Default submit button text  
FormBuilderForm::successMessage string Message to display on successful form submission  

Entries

NameReturnSummary 
FormBuilderForm::entries()
FormBuilderEntriesGet this form’s entries instance (FormBuilderEntries) 
FormBuilderForm::entryDays int Maximum days an entry is allowed to be saved in the system  
FormBuilderForm::listFields array Field names to show in entries list by default  
FormBuilderForm::partialEntryDays int Maximum days to allow an incomplete/partial entry to exist in the system  
FormBuilderForm::partialEntryType int Storage type to use for partial entries (0=session, 1=database)  
FormBuilderForm::spamEntryDays int Maximum days a spam entry is allowed to be saved in the system  

Pagination

NameReturnSummary 
FormBuilderForm::getNumPaginations()
intReturn quantity of paginations found in form 
FormBuilderForm::getPageBreakFields()
arrayGet array of fields having type `FormBuilderPageBreak`, indexed by page number 
FormBuilderForm::hLevel int Headline level that is used above forms with pagination. 0=off, 1=H1, 2=H2, 3=H3, etc.  
FormBuilderForm::showNav int Use select nav above paginations? 0=off, 1=before headline, 2=after healdline, 3=after description  

Properties

NameReturnSummaryDefault
FormBuilderForm::allowPreset bool int Preset field values from GET variables? false
FormBuilderForm::firstEntryDate string Date of first submitted form entry 
FormBuilderForm::flags int Form flags, see the FormBuilderProcessor class formFlag* constants 
FormBuilderForm::formFlags int Alias of $flags $pw-internal 
FormBuilderForm::framework string Name of HTML/CSS framework used by this form  
FormBuilderForm::id int Form ID 
FormBuilderForm::lastEntryDate string Date of last submitted form entry 
FormBuilderForm::mobilePx int Mobile responsive breakpoint for this form (in pixels).  
FormBuilderForm::name string Form name 
FormBuilderForm::numEntries int Number of entries (form submissions) for this form 
FormBuilderForm::numFields int Number of fields in this form 
FormBuilderForm::pluginActions array Names of plugin actions enabled for this form 
FormBuilderForm::roles array Form roles for access control 
FormBuilderForm::saveFlags int Bitwise flags for save actions (see FormBuilderProcessor class saveFlag* constants) 
FormBuilderForm::skipSessionKey bool int Disable session tracking and CSRF protection? false
FormBuilderForm::theme string Name of jQuery UI theme used by this form (if any) 
FormBuilderForm::useCookies bool int Remember form values in cookies? false

Spam

NameReturnSummary 
FormBuilderForm::akismet string CSV data for Akismet configuration  
FormBuilderForm::honeypot string array Name of field in form to be used as a honeypot (or array of them if you prefer)  
FormBuilderForm::spamFlags int null Spam flags to dictate what should happen when spam is detected (0=none, 2=silent, 4=verbose, 8=save spam entry)  
FormBuilderForm::spamWords array null If any of these words are present in form submission, it is considered spam (if spam words enabled)  

Email

Settings for administrator email.

NameReturnSummary 
FormBuilderForm::emailFrom string Email reply-to address (also used as from address if emailFrom2 not specified)  
FormBuilderForm::emailFrom2 string Email from address (if different from emailFrom)  
FormBuilderForm::emailSubject string Email subject line  
FormBuilderForm::emailTo string Email address, addresses, or format string to send form admin results to  

Responder

Settings for auto-responder email.

NameReturnSummary 
FormBuilderForm::responderBody string Body of auto-responder  
FormBuilderForm::responderFrom string Responder from address  
FormBuilderForm::responderFromName string Responder from "name"  
FormBuilderForm::responderReplyTo string Reply-to email address for auto-responder  
FormBuilderForm::responderSubject string Subject of auto-responder  
FormBuilderForm::responderTo string Field that will contain submitters email address (CSV string for multiple)  

Dup submit

Settings for sending a duplicate copy of the form submission to another URL.

NameReturnSummary 
FormBuilderForm::action2 string Duplicate submission URL  
FormBuilderForm::action2_add string Add fields to duplicate submission (textarea format string)  
FormBuilderForm::action2_remove string Newline separated field names to remove from duplicate submission  
FormBuilderForm::action2_rename string Key=value format string of fields to rename in duplicate submission, one per line.  

Google sheets

To populate a Google Sheet you must have the GoogleClientAPI module installed.

NameReturnSummary 
FormBuilderForm::googleSheetsResponseField string Optional name of form field to populate Google Sheets response into.  
FormBuilderForm::googleSpreadsheetFields array null Names of form fields to populate into Google Sheet, in order.  
FormBuilderForm::googleSpreadsheetUrl string null Full URL of Google Sheet to populate submitted form entries to.  

Additional methods and properties

In addition to the methods and properties above, FormBuilderForm also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.251