PDA

View Full Version : Multi-page forms



thesuperav
26-Sep-2006, 04:07 PM
I'm writing a multi-page survey using Formmail. One of the pages depends on a previous page. If an option was chosen on a previous page, then the later page should display certain form controls, while if another option was chosen, then those form controls should not appear.

It says on the Multi-page Form guide that a reason to use multi-page forms is because "you need to control what information to collect based on the answers the user provided for previous form values (fields)", which is what I need.

What's the easiest way of going about this?

Is it possible to access fields in Javascript? And if so, how?

Thanks

russellr
26-Sep-2006, 08:10 PM
Hi,

Currently, the way you do this is a bit clunky.

You need to arrange to set the "next_form" field based on the answers provided. By doing this you select a different template (next page) to show depending on the answers the user has provided on the current page.

You can do this with an HTML "select" or radio buttons. You can also use JavaScript (but we never recommend that).

You can also use the %if...% feature in derive_fields to set "next_form".

But, now, there's a non-clunky solution.....:D

However, we've just completed (but not yet released :() a brand new feature called "Advanced Templates"!!!

This means you can do stuff like this in your multi-form templates:


<if option1>
<!-- Show content and fields for this option -->
</if>
<if option2>
<if option3>
<!-- Show content and fields for option2 and option3 both selected -->
</if>
</if>


This new feature requires the FormMail Computation Module, which is not a free product.

Email me (http://www.tectite.com/contacts.php) if you'd like early access to this feature and I'll discuss the licensing fees with you.