<select1 ref="Question1" jump=”Question6,1”>
<label>Please choose an answer?</label>
The example above shows a simple, three choice <select1> question which has the attribute ref="Question1" (Remember, the ref="" attribute specifies a unique reference for a particular question). In this example, we want to specify that, if a user chooses answer one, they will then jump ahead to the question which has the attribute ref="Question6" . All other choices will proceed to the next question in the form.
The jump="" attribute allows you to specify a condition which is acted upon when a user submits a question.
Specifying a single jump clause
The format for specifying a jump is as follows:
jump="ref of question to jump to,clause"
The clause defines whether a particular choice is made or not, and is based on the numbering of the items from 1 to n, where n is the last item.
In the example above, the 'question to jump to' is specified as 'Question6' which refers to the ref="" attribute of the question further in the form. The clause is set as '1' which means jump if the user choices item 1.
Specifying multiple jump clauses
The jump="" attribute can accept multiple 'questiontojumpto,clause' instances separated by commas.
So in our example, if we wished to specify that, as well as the clause on item1, that we wanted to jump to Question 10 if the user chooses item 3, we can use the following:
Specifying a jump clause if an item is NOT chosen
We can use the '!' character within a clause to specify to jump to a particular question if an item is NOT chosen.
So in our example, if we now wish to specify that all answers EXCEPT item 1 should jump the user forward to Question 6, we can use:
Again, this can be used when specifying multiple clauses
A common example
- specifying 'other' and capturing a users input.
Quite often within a <select1>, <select> or <radio> question one may define a number of <item>'s and the final choice would be 'other'. In these cases, where it is not possible to define all possible choices in a list, you may wish the user to enter text to describe their 'other' choice. This can be done using a jump questions based on your questions ref="" attributes.
Consider the following three question form:
<select1 ref="colourquestion" jump=”namequestion,!3”>
<label>What is your favourite colour?</label>
<label>Please specify other</label>
<label>What is your name?</label>
Three questions are listed. Firstly, a <select1> which asks the user 'What is your favourite colour?' with three choices - red, yellow or other. The second, is a simple text input asking the user to 'Please specify other'. The third is another text input asking 'what is your name'
We only want the user to be presented with the second question (Please specify other) if they choose the 'other' item in the first question.
We achieve this by using the jump= attribute as follows:
Simply, this specifies to jump to the question with ref="namequestion" if the user DOES NOT choose item 3
The following screenshots show how this would be presented to a user and the possible choices