Q4Widgets API Documentation

q4.formbuilder

A more flexible solution to Formbuilder 2 Please note that this uses HTML 5 validation which doesn't play to nice with our full page form. Once this is removed this should hopefully become a more viable solution, but for the time being a few hacks are required to other modules which often appear on the same pages as formbuilder Module Search - Should still function as expected but has a additional click handler in place Mailing List Signup - No good way to get this work, the submit button will bring you to the default signup page note: `emailAlertsPage` will need to be modified for this

Latest Version Updates:
1.1.8 - Added emailConfirmOpts option and custom validation functionality to handle an Email Confirmation input field.


Script link
q4.formbuilder.1.1.9.min.js
Source file
q4.formbuilder.js, line 2
Requires

Options

emailAlertsPage string
The URL for email alerts page.
Default value
/contact-us/email-alerts/default.aspx
emailNameString stringArray
Label text for email fields. This is required so that email fields are validated correctly.
Default value
Email Address
Example
"Email Address" or ["Email Address","Some other email Address"]
emailConfirmOpts Object
Options used for Email Confirmation validation which include:
  • emailInputName (string): The name (also used as the label) of the email address input field.
  • emailConfirmInputName (string): The name (also used as the label) of the email confirmation input field.
  • errorMsg (string): The error message displayed when the fields do not match.
Default value
{"emailInputName":"","emailConfirmInputName":"","errorMsg":"Value must match Email field"}
Example
{
   emailInputName: "Email Address", 
   emailConfirmInputName: "Email Confirmation", 
   errorMsg: "Value must match Email field"
}
introText string
A message or HTML string to display as intro text. Defaults to empty string.
introSelector string
A CSS selector for introduction text element.
Default value
.module_introduction
beforeRender function
A callback that fires before the widget is rendered.
Parameters
formData object
An array of form data.
onComplete function
A callback that fires after the entire widget is rendered.
onSubmit function
A callback that fires after the form is submitted and the error messages (if necessary) are rendered.