thecodemine / formwizard

jQuery plugin based on top of jQuery UI which turns a form into a multistep wizard. Integrates with the jQuery form plugin for AJAX submission of the form, the validation plugin for client side validation and the BBQ plugin for enabling the browsers back and forward buttons.
140 stars 54 forks source link

branching feature is not straightforward #8

Closed ghuser closed 13 years ago

ghuser commented 13 years ago

It is not easy to understand how exactly branching feature works. By looking at example_2_branch.html I cannot find branching configuration.

Does the plugin somehow autodetect that I want to branch by looking at the option values of any select element on any step?

If yes this is a bug, because I might end up with a branch without really wanting it, just because some names matched with ids. In any case nowhere is documented how branching really works.

I believe the default behaviour of the plugin should be the "branching not enabled".

thecodemine commented 13 years ago

Thanks for your input.

As you pointed out, the documentation of the branching (and probably other features) is lacking from the example pages and from the project web site. I'll try to remedy this at some point when a new release is warranted.

Regarding the actual branching functionality, the plugin does not look at all selects, checkboxes etc for finding out how to branch - it only looks at the inputs (on the current step) that have the class "link" set. The branching is based on the value of the "link" (e.g. value of a select or checkbox) being equal to the id of the target step.

This is by design, and as long as you do not add the class="link" on input fields, the plugin will default to "branching not enabled".

Hope this explains it a bit.

ghuser commented 13 years ago

Thank you, Now it is more clear for me!