It's not working! (FAQs)

It is not working and I don't understand the snippet code.

Like any PHP code, learning the PHP basics is recommended. If you do not understand what each line of code does, it is hard to expect you to understand how it all fits together. Firstly, get to know a little basic PHP. At least to the point that you understand what each line of code does. Secondly, edit your snippet in a coding program that at will at least show you errors in your PHP syntax. There are plenty of free editors around such as Netbeans, Aptana and Eclipse.

Check your PHP error logs

All servers are different and PHP logs may be in some cases be displayed on screen, hidden in logs, or recorded into a database. Depending on your setup you need to determine the best way to access these logs. Generally the log will give you a good hint at where your snippet has a problem.

Why does the email contain contain only "[ [+FormItBuilderEmailTpl] ]"

Ensure you are specifying the name of your snippet within the snippet. Because the email hook needs to re-run the same snippet (and because there is no way to get the name of a snippet form within a snippet) this is required. So if your snippet name is FormItBuilder_homeEnquireForm it must be passed into the setPostHookName.

$snippetName = 'FormItBuilder_homeEnquireForm';
//main snippet code here
$o_form->setPostHookName($snippetName);
//main snippet code here

Call to undefined method FormItBuilder::processCoreHook()

Make sure you have installed at least version 1.3.0pl. The processCoreHook method did not exist until this release.

Element "" is not a FormItBuilder_baseElement

Probably the most common question. This will occur if you are passing an empty object into a FormRule. If you do this

new FormRule(FormRuleType::required,$fieldObject_that_doesnt_exist);

then you will get this error. Make sure all variables are defined and if need be, check they are not empty using the "empty()" php function or run an array of elements through the "print_r()" command to get more information about each element.

Call to a member function getId() on a non-object

Again a similar issue to the above. This will occur if you are passing an empty object into the addElement method in the FormItBuilder object. If you do this

$o_form->addElements(array($fieldObject_that_doesnt_exist));

then you will get this error. Make sure all variables are defined and if need be, check they are not empty using the "empty()" php function or run an array of elements through the "print_r()" command to get more information about each element.

Call to undefined method FormItBuilder::some_invalid_method()

You are calling a method that doesn't exist. Check the FormItBuilder object documentation for valid methods.

The jQuery Validation is not working

Firstly make sure you have the FormItBuilder object setup to include the needed javascript.

$o_form->setJqueryValidation(true);

if this is the case you should see a bunch of jQuery Validation javascript in your HTML source. That is unlessless you have chosen to use a placeholder like

$o_form->setPlaceholderJavascript('FormItBuilder_javascript_myForm');

if so follow this guide.

Lastly... make sure you have included jQuery and jQuery Validation javascript files in the head of your HTML. Also check any javascript warnings using something like the Firefox Web Developer Toolbar. If other javascript is causing errors it may be stopping the jQuery Validation from doing its job.