Enter Promo Code

Submit

Configuring FormBuilder

FormBuilder is a script that allows you to easily create fantastic AJAX forms, complete with validation and a great design, which are sent directly to your email. This article follows the ways in which you can configure it.

The script provides a special configuration file (located at assets/includes/config.php) that gives you a great deal of control on the presentation of your forms.

Adding your email address

The first and most important step in configuring the script is adding the email address at which you are going to receive the form submissions. This is as easy as adding a value to an array.

$config['recipient']	= array(
    'Homer Simpson' => 'homer@simpson.com'
);

Notice that you need to provide both a key (which contains the name of the recipient) and a value (which is the recipient's email. You can even choose to have the message delivered to more than one address. Simply add more values to this array like this:

$config['recipient']	= array(
    'Homer Simpson'	=> 'homer@simpson.com',
    'Bart Simpson'	=> 'bart@simpson.com',
    'Marge Simpson'	=> 'marge@simpson.com'
);

Changing the form design

Currently there are two designs available - the dark (the default) one, and a light one. You can choose which design you want your forms to use by changing the $config['colorTheme'] variable.

$config['colorTheme'] = 'light';

You can alternatively design your own color theme from scratch, but this would require intimate knowledge of CSS.

Changing the form title

You can quickly change the title of the form title from the $config['headerText'] variable. By default it is "Contact Form", but you can make it to anything you like. This name is displayed above the form, and also in the email message that you receive to help you distinguish where it originated from. So if you have more than one form on your site, it would be a good idea to add different titles to your forms.

$config['headerText'] = 'Drop me a line';

Adding a captcha

You can add a catpcha to prevent spam bots from submitting your form. The captcha is in the form of a simple math problem to add two numbers together. You can add it to your form with this setting:

$config['captcha'] = true;

Adding form fields

FormBuilder makes it possible to generate self-validating AJAX web forms by specifying their fields as regular PHP arrays.

Learn more about it here: Adding form fields in FormBuilder