Search code examples
javascriptjqueryjquery-uiformwizard

Rejoin branching using jQuery formwizard?


jQuery formwizard (http://thecodemine.org/) allows you to branch a form wizard based on inputs. I am trying to figure out if it possible to rejoin the branches (and not just for the last step.)

e.g. Based on the inputs to Step 1, I'd like to present the user with a different step 2. However, after step 2, the remaining steps (step 3, 4, 5, etc.) should all be the same.

How can this be done?

Thanks!


Solution

  • this would just be a matter of using a link for one of the "second" steps. This is done by specifying a hidden input field with a class="link" and have the value set to the id of the step that should follow next. Like this (see "second step"):

    <div class="step" id="first">
        navigates to either second or third step depending on what is selected in the dropdown
        <select class="link" name="firstlink" id="firstlink">
            <option value=""></option>
            <option value="second">go to second</option>
            <option value="third">go to third</option>
        </select>
    </div>
    <div class="step" id="second">
          uses a link to go to fourth step
          <input class="link" value="fourth" />
    </div>
    <div class="step" id="third">
          falls through to fourth steo
    <div>
    <div class="step" id="fourth">
          common step
    <div>
    

    Hope this helps