Form Self Generating Logic

From All n One's bxp software Wixi

Revision as of 17:14, 22 March 2014 by Philip Lacey (talk | contribs)
Jump to: navigation, search

1 Overview

Within any web page, in order to create a logical path through the script, JavaScript is used to show and hide elements. The principle of self generating logic is that elements show and hide depending on options selected in closed questions. The process initially hides all items and then depending on what options are selected, options are displayed again appropriate to the answers selected.

So with a closed question, any number of subsequent questions will be shown or hidden as appropriate. For more information on Open and Closed types click here Form_Closed_Vs._Open_Questions

So for a Yes/No type, If Yes, show Question 1. If No, show Question 2. This is also called logic branching in other systems and approaches. Question 1 and 2 are referred to in BE as "options".

BE has the ability to generate the JavaScript to create this show/hide effect on the form automatically.


2 High Level Procedure

The procedure is as follows:

  1. Add all the questions you need to the form. e.g. 3 questions. Yes/No question. Text Answer 1. Text Answer 2.
  2. Go to the Logic Management section
  3. The Logic Management section will allow you to enter a correct number of options for the appropriate type. There is a limit of 20 answers for each closed type. If more than 20 options, no logic can be added to that type. e.g. Yes/No type has 2 possible options. We add the logic of the two options to the question. The destinations are separated by the semi colon. So option 1 ; option 2. To the left of every question is an Id number, it is this Id that is used for the branches. The input would probably be 3;4 if:
    1. Header (Added to all forms by default)
    2. Yes / No
    3. Text Option 1
    4. Text Option 2
  4. With all the logic in place, it needs to be enabled. At the top of the screen from the Use Self Generating Logic option, choose True.


3 Notes

For any given branch, you may wish to display more than one question at a time. The comma , is used to separate the questions you wish to display for a given option. Using the example above if we wanted to show a third text option for the No part, then the text would likely be 3;4,5

  1. Header
  2. Yes / No
  3. Text Option 1
  4. Text Option 2
  5. Text Option 3

These options are for the vertical delivery.