How can I have different prompts for the same field?
Posted: Fri Jun 13, 2003 2:13 pm
The <prompt> tag's "count" attribute specifies how many times the user must have visited the form item containing a given prompt before it is played. E.g.
In the above example (assuming the user provides no input or invalid input), the user will hear the following prompts in succession:
1 - Please enter a number.
2 - Please enter a number.
3 - Using your telephone keypad, enter a number.
4 or higher - Using your telephone keypad, enter a number.
Note that in the absence of a prompt whose count attribute exactly matches the number of the current iteration (in this example, 2, 4 or greater than 4), the prompt with the largest count attribute that is less than the number of the current iteration will be selected.
Code: Select all
<form id="form1">
<field name="blah" type="digits">
<prompt count="1">
Please enter a number.
</prompt>
<prompt count="3">
Using your telephone keypad, enter a number.
</prompt>
<filled>
You entered <value expr="blah" />
</filled>
<catch event="nomatch noinput">
<reprompt />
</catch>
</field>
</form>
1 - Please enter a number.
2 - Please enter a number.
3 - Using your telephone keypad, enter a number.
4 or higher - Using your telephone keypad, enter a number.
Note that in the absence of a prompt whose count attribute exactly matches the number of the current iteration (in this example, 2, 4 or greater than 4), the prompt with the largest count attribute that is less than the number of the current iteration will be selected.