ChronoForms form applications can become very complex and debugging is not always simple. Here are a series of steps that should resolve most problems with simple forms and give some help with more complex or difficult ones.
Test with a simple form
If you are new to ChronoForms, or are using one of the features for the first time, it always helps to start with a simple form - just one text input, a submit button and a Show HTML action is enough. Once you are sure this displays and submits then you can add more functionality.
Use a copy form
It can be enormously fustrating to try to debug a long form full of validated fields and security checks. It is easy to use the Copy icon in the Forms Manager toolbar to make a copy of the form and use the copy for debugging, you can remove all of the unnecessary features, elements and actions so that you can focus on the part of the form that is causing problems.
Use the Test View
When you use the Form Wizard there is a Test View icon in the Toolbar that will work after your form is saved. When you click it your form will open in a new browser tab without the site template. This removes much of the complexity that some templates can add and lets you see the form functionality standing alone.
Technically this loads the form adding &tmpl=component to the URL. Just what extra features the template adds depends on the way the template is coded. You should get a clean form, if there are extra page elements or scripts loaded then it may help to switch to a standard Joomla! templte to debug your form.
If you don't see the elements in your form in the Test View (or you only see the ChronoForms strap line) then you probably haven't added a Show HTML action to the On Load event.
Add a Debugger action
ChronoForms has a Debugger action that you can drag into any event. It will display the contents of the $form->data array at the point when the debugger runs and the debug output from any form actions that you have added. Some actions, like Show HTML action, don't have any debug output; others, like the Email action, will output many lines.
Some actions allow you to turn debug reporting for the action on and off separately, but they still require the Debugger action to be in added to show the debug output.
You can add more than one Debugger action to an event to see what is changing in the $form->data array (there's an option to clear other error messages so that they don't get repeated).
You can add a Debugger action to the On Load event to see what data is being received by the form.
When you are finished with a Debugger action remove it by Clicking the red 'x' icon in the action. You can always drag in another copy later if you need it.
If you are using the Easy Wizard you may need to switch to the Advanced Wizard to do this; if you want to continue to use the Easy Wizard please make a copy of your form first and add the Debugger action to the copy.
Add debug code in Custom Code actions
You can use PHP in Custom Code actions to give you more specific debug output. It can be helpful, for example to display a single item from the $form->data array. This code will output a debug message about the value of 'input_name' as a System message (one of the red or blue messages that Joomla! can display at the top of a page).
<?php
$mainframe =& JFactory::getApplication();
$mainframe->enqueuemessage('$form->data[input_name]: '.print_r($form->data['input_name'], true).'<hr />');
?>
or you can just add a debug message to the normal Debugger action output, if you have the action in place:
<?php
$form->debug['title'] = "Some text: ".$some variable;
?>
or you can show a message in the normal form output using the ChronoForms print_r2() function
<?php
print_r2($some_variable);
?>
or a plain echo()
<?php
echo'<div>$some_variable: '.print_r($some_variable, true).'</div>';
?>
Which of these is most useful depends on the situation. I probably use the first 'system message' most often as it shows the output clearly at the top of the page separated from the form output.
Use your web browser Developer Tools
All the current main browsers have excellent web developer tools that are built in or can be added: In Internet Explorer 8 or 9 Click F12; in Chrome click F12 or Shift+Ctrl+I; install the FireBug add in for FireFox (also available for Chrome), or DragonFly in Opera.
These tools will let you do many things with forms they are invaluable for viewing the actual HTML that is being generated; for checking on the parameters sent when a form is submitted; for checking on and debugging JavaScript; for seeing where the CSS in use is coming from; and much more.
The Web Developer Tools for Internet Explorer let you switch to IE7, 8 or 9 browser modes which can help debug IE version specific problems.
Use the FAQs and the forums
This probably isn’t the first time that your question has been asked, but the other people may word it differently. Both the forums and the FAQs allow you to search on key words and phrases.
You can also use the
ChronoSearch which is a Custom Google search built with ChronoForms covering the ChronoEngine site, my GreyHead.net site and the Joomla! Documents site.
If you still don't find an answer please post your question in the forums.